EnumReflection<O> class abstract

Base for Enum reflection.

Inheritance
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 const List 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 const List of fields names.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hasObject bool
Returns true if 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_factory Version 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 const List 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 const Map of values by name.
no setter
valuesNames List<String>
Returns a List of values names.
no setter

Methods

callCasted<R>(R function<O>(EnumReflection<O> enumReflection)) → R
Calls function with correct casting for EnumReflection.
override
castCollection(dynamic o, TypeInfo typeInfo, {bool nullable = false}) Object?
Cast o to a collection represented by typeInfo.
inherited
castIterable(Iterable itr, Type type, {bool nullable = false}) Iterable?
Cast itr to reflectedType if type == reflectedType or return null.
inherited
castList(List list, Type type, {bool nullable = false}) List?
Cast list to reflectedType if type == reflectedType or return null.
inherited
castMap(Map map, TypeInfo typeInfo, {bool nullable = false}) Map?
Cast map keys & values to reflectedType if type == reflectedType or return null.
inherited
castMapKeys(Map map, TypeInfo typeInfo, {bool nullable = false}) Map?
Cast map keys to reflectedType if type == reflectedType or return null.
inherited
castMapValues(Map map, TypeInfo typeInfo, {bool nullable = false}) Map?
Cast map values to reflectedType if type == reflectedType or return null.
inherited
castSet(Set set, Type type, {bool nullable = false}) Set?
Cast set to reflectedType if type == reflectedType or return null.
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 staticInstance of the generated EnumReflection.
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, obj or T.
siblingReflectionFor<T>({T? obj, Type? type}) Reflection<T>?
Returns a Reflection for type, obj or T.
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 obj as 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