TJPrimitive Class
Represents a JSON primitive value (string, number, or Boolean).
Remarks
TJPrimitive stores a single JSON value and provides type-safe access via the AsBoolean, AsString, AsDouble, AsInteger, and AsInt64 methods. Use the IsBoolean, IsString, etc.
methods to check the actual type before conversion.
Syntax
Unit: Bcl.Json.Classes
TJPrimitive = class(TJElement);
Constructors
| Name | Description |
|---|---|
| Create | Overloaded Create(Boolean) Create(Double) Create(Integer) Create(Int64) Create(string) |
Methods
| Name | Description |
|---|---|
| Clone | Creates a deep copy of this JSON primitive. |
| AsBoolean | Returns the value as a Boolean. Attempts type conversion if the stored value is not Boolean. |
| AsString | Returns the value as a string. |
| AsDouble | Returns the value as a Double. Attempts type conversion if the stored value is not Double. |
| AsInteger | Returns the value as an Integer. Attempts type conversion if the stored value is not Integer. |
| AsInt64 | Returns the value as an Int64. Attempts type conversion if the stored value is not Int64. |
| IsBoolean | Returns True if the stored value is a Boolean. |
| IsString | Returns True if the stored value is a string. |
| IsDouble | Returns True if the stored value is a Double. |
| IsInteger | Returns True if the stored value is an Integer. |
| IsInt64 | Returns True if the stored value is an Int64. |