# ObjectNode

The JsonObject class represents a JSON object node and provides methods for manipulating its data.

### Methods

* `get(key: String): JsonNode`

Retrieves the value of the specified property from the JSON object.

***

* `put(key: String, intValue: Integer): void`

Adds or replaces a property with an integer value.

***

* `put(key: String, longValue: Long): void`

Adds or replaces a property with a long value.

***

* `put(key: String, floatValue: Float): void`

Adds or replaces a property with a float value.

***

* `put(key: String, doubleValue: Float): void`

Adds or replaces a property with a double value.

***

* `put(key: String, textValue: String): void`

Adds or replaces a property with a text value.

***

* `put(key: String, value: JsonNode): void`

Adds or replaces a property with a JsonNode value.

***

* `get(key: String): JsonNode`

Retrieves a property value, as JsonNode.

***

* `remove(key: String): void`

Removes a property.

***

* `has(key: String): Boolean`

Checks if a property exists.

***

* `size(): Integer`

Retrieves the number of properties.

***

* `clear(): void`

Removes all properties.

***

* `isEmpty(): Boolean`

Checks if the object node is empty.

***

* `toString(): String`

Returns the JSON node as a JSON string.

### Examples

```javascript
var objectNode = JsonUtil.createObjectNode();

// Add properties to the JSON object
objectNode.put("name", "John Doe");
objectNode.put("age", 30);
objectNode.put("isStudent", true);
objectNode.put("scores", 6.2);

// Retrieve a property value
var name = objectNode.get("name").toString();
var age = objectNode.get("age").asInt();
var isStudent = objectNode.get("isStudent").asBoolean();
var scores = objectNode.get("scores");

// Remove a property
objectNode.remove("age");

// Check if a property exists
var hasAge = objectNode.has("age");

// Get the number of properties
var numProperties = objectNode.size();

// Clear all properties
objectNode.clear();

// Check if the object is empty
var isEmpty = objectNode.isEmpty();

// Get the JSON representation
var jsonString = objectNode.toString();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2winsuite.com/5.4/scripting/types-and-objects/objects/objectnode.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
