JsonInteger class
A JSON field that handles integer values.
The JsonInteger
class extends JsonField<int>
and provides
functionality to parse and serialize integer values from JSON data.
Example Usage:
// Creating a JsonInteger instance with the field name "age"
JsonInteger ageField = JsonInteger("age");
// Setting the value using an integer
ageField.value = 25;
// Setting the value using a string that can be parsed to an integer
ageField.value = "30";
// Getting the integer value (returns 30)
int age = ageField.value;
Constructors
- JsonInteger(String fieldName)
-
Creates a new JsonInteger with the given
fieldName
.
Properties
- error ↔ String?
-
Error message associated with the field.
getter/setter pairinherited
- fieldName → String
-
The name of the field.
finalinherited
- hasError → bool
-
Checks if the field has an error.
no setterinherited
- hashCode → int
-
Overrides the hash code.
no setterinherited
- hasInformation → bool
-
Checks if the field has informational message.
no setterinherited
- hasWarning → bool
-
Checks if the field has a warning.
no setterinherited
- information ↔ String?
-
Informational message associated with the field.
getter/setter pairinherited
- rawValue ↔ int?
-
The raw value of the field.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ int
-
Gets the integer value of this field.
getter/setter pairoverride
- warning ↔ String?
-
Warning message associated with the field.
getter/setter pairinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJSON(
) → int? -
Converts the integer field to a JSON-compatible format.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
Overrides the equality operator.
inherited