ConvertibleValue class abstract
Abstraction for holding a raw value and its converted state.
A ConvertibleValue stores an original _value, an optional _convertedValue,
and whether it has been marked as _converted. Subclasses can extend this
to provide richer semantics such as pod property values or constructor
arguments.
This class is used throughout the framework to track values that may need type conversion during pod instantiation and property population.
Example usage:
final cv = PropertyValue('host', 'localhost');
print(cv.value); // 'localhost'
cv.setConvertedValue('127.0.0.1');
print(cv.convertedValue); // '127.0.0.1'
- Inheritance
-
- Object
- ObjectHolder<
Object?> - ConvertibleValue
- Implementers
Constructors
- ConvertibleValue(Object? value, {String? packageName, String? qualifiedName})
- Abstraction for holding a raw value and its converted state.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
equalizedProperties(
) → List< Object?> -
Mixin-style contract for value-based equality,
hashCode, andtoString.inherited -
getConvertedValue(
) → Object? - Returns the converted value after type transformation has been applied.
-
getPackageName(
) → String? -
Returns the package name associated with the held object, or
nullif not provided.inherited -
getQualifiedName(
) → String? -
Returns the fully qualified name associated with the held object,
or
nullif not provided.inherited -
getType(
) → Class? -
Returns the type of the held value.
inherited
-
getValue(
) → Object? -
Returns the underlying held value of type
T.override -
isConverted(
) → bool - Returns whether the value has been successfully converted.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setConvertedValue(
Object? convertedValue) → void - Sets the converted value and marks the value as converted.
-
toString(
) → String -
A string representation of this object.
inherited
-
toStringOptions(
) → ToStringOptions -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited