EnumReflection<O> class
abstract
Base for Enum reflection.
- Inheritance
-
- Object
- Reflection<
O> - EnumReflection
- Implemented types
Constructors
- EnumReflection(Type enumType, String enumName, [O? object])
Properties
-
asTypeReflection
→ TypeReflection<
O> -
Returns reflectedType as a TypeReflection.
no setterinherited
-
classAnnotations
→ List<
Object> -
Returns a
constList of class annotations.no setteroverride - enumName → String
-
Then reflected enum name (without minification).
final
- enumType → Type
-
Then reflected enum Type.
final
-
fieldsNames
→ List<
String> -
Returns a
constList of fields names.no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- hasObject → bool
-
Returns
trueif this instances has an associated object (O).no setteroverride - languageVersion → Version
-
Returns the Dart language Version of the reflected code.
no setteroverride
- object → O?
-
final
- reflectedType → Type
-
The reflected type by this implementation.
no setteroverride
- reflectionFactoryVersion → Version
-
Returns
reflection_factoryVersion used to generate this reflection code.no setteroverride - reflectionLevel → int
-
The reflection level (complexity).
no setteroverride
- reflectionName → String
-
The reflected type name by this implementation. See reflectedType.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
staticFieldsNames
→ List<
String> -
Returns a
constList of static fields names.no setter - typeInfo → TypeInfo
-
Returns reflectedType as a TypeInfo.
no setterinherited
-
values
→ List<
O> -
Returns the Enum values.
no setter
-
valuesByName
→ Map<
String, O> -
Returns a
constMap of values by name.no setter -
valuesNames
→ List<
String> -
Returns a List of values names.
no setter
Methods
-
callCasted<
R> (R function< E>(EnumReflection< ) → RE> enumReflection) -
Calls
functionwith correct casting for EnumReflection.override -
castCollection(
dynamic o, TypeInfo typeInfo, {bool nullable = false}) → Object? -
Cast
oto a collection represented bytypeInfo.inherited -
castIterable(
Iterable itr, Type type, {bool nullable = false}) → Iterable? -
Cast
itrto reflectedType iftype== reflectedType or returnnull.inherited -
castList(
List list, Type type, {bool nullable = false}) → List? -
Cast
listto reflectedType iftype== reflectedType or returnnull.inherited -
castMap(
Map map, TypeInfo typeInfo, {bool nullable = false}) → Map? -
Cast
mapkeys & values to reflectedType iftype== reflectedType or returnnull.inherited -
castMapKeys(
Map map, TypeInfo typeInfo, {bool nullable = false}) → Map? -
Cast
mapkeys to reflectedType iftype== reflectedType or returnnull.inherited -
castMapValues(
Map map, TypeInfo typeInfo, {bool nullable = false}) → Map? -
Cast
mapvalues to reflectedType iftype== reflectedType or returnnull.inherited -
castSet(
Set set, Type type, {bool nullable = false}) → Set? -
Cast
setto reflectedType iftype== reflectedType or returnnull.inherited -
compareTo(
EnumReflection other) → int -
Compares this object to another object.
override
-
from(
Object? o) → O? -
Returns an Enum instance by
o. -
fromJson(
Object? json) → O -
Returns an Enum instance from
json.override -
fromJsonEncoded(
String jsonEncoded) → O -
Returns an Enum instance from
jsonEncoded.override -
getIndex(
O? enumInstance) → int? -
Returns the index of
enumInstance. -
getName(
O? enumInstance) → String? -
Returns the name of
enumInstance. -
getStaticInstance(
) → EnumReflection< O> -
Returns the
staticInstanceof the generated EnumReflection. -
getSymbol(
String? key) → Symbol? -
Returns a
constSymbol that can be safely used for named parameters in Function.apply.inherited -
name(
[O? obj]) → String? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
) → void -
Called automatically when instantiated.
Registers this reflection into ReflectionFactory.
override
-
siblingEnumReflectionFor<
T> ({T? obj, Type? type}) → EnumReflection< T> ? -
Returns a siblingsEnumReflection for
type,objorT. -
siblingReflectionFor<
T> ({T? obj, Type? type}) → Reflection< T> ? -
Returns a Reflection for
type,objorT.inherited -
siblingsEnumReflection(
) → List< EnumReflection> - Returns a List of siblings ClassReflection (declared in the same code unit).
-
siblingsReflection(
) → List< Reflection> -
Returns a List of siblings Reflection (declared in the same code unit).
inherited
-
toJson(
[O? obj, JsonEncoder? jsonEncoder]) → String? -
Returns a enum instance as a JSON value.
override
-
toJsonEncoded(
{O? obj, JsonEncoder? jsonEncoder, bool pretty = false}) → String -
Returns a JSON encoded. See toJson.
override
-
toJsonMap(
{O? obj, JsonEncoder? jsonEncoder}) → Map< String, Object> ? -
Returns a enum instance as a JSON Map.
override
-
toString(
) → String -
A string representation of this object.
override
-
withObject(
[O? obj]) → EnumReflection< O> -
Returns a new instances with
objas the associated object (O).override -
withoutObjectInstance(
) → EnumReflection< O> -
Returns a new instances without an object instance.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited