TypeInfo<T> class
- Available extensions
Constructors
-
TypeInfo(Type type, [Iterable<
Object> ? arguments]) -
TypeInfo.from(Object o, [Iterable<
Object> ? arguments, Object? object]) -
factory
- TypeInfo.fromIterableType(Object itrType)
-
factory
- TypeInfo.fromListType(Object listType)
-
factory
- TypeInfo.fromMapType(Object keyType, Object valueType)
-
factory
-
TypeInfo.fromObject(T o, [Iterable<
Object> ? arguments, Object? object]) -
factory
- TypeInfo.fromSetType(Object setType)
-
factory
-
TypeInfo.fromType(Type type, [Iterable<
Object> ? arguments, Object? object]) -
factory
Properties
-
arguments
→ List<
TypeInfo> -
no setter
- arguments0 → TypeInfo?
-
Available on TypeInfo<
The argument at indexT> , provided by the TypeInfoEntityExtension extension0(in arguments).no setter - arguments0 → TypeInfo?
-
The argument at index
0(in arguments).no setter - arguments1 → TypeInfo?
-
Available on TypeInfo<
The argument at indexT> , provided by the TypeInfoEntityExtension extension1(in arguments).no setter - arguments1 → TypeInfo?
-
The argument at index
1(in arguments).no setter - argumentsLength → int
-
The arguments length.
no setter
- asTypeReflection → TypeReflection
-
Returns this instance as TypeReflection.
no setter
- entityType → Type?
-
Available on TypeInfo<
Returns a valid entity Type.T> , provided by the TypeInfoEntityExtension extensionno setter - entityTypeInfo → TypeInfo?
-
Available on TypeInfo<
Same as entityType. Returns a valid entity TypeInfo.T> , provided by the TypeInfoEntityExtension extensionno setter - genericType → Type
-
The generic
TType.no setter - hasArguments → bool
-
Returns
trueif type has arguments.no setter - hashCode → int
-
The hash code for this object.
no setteroverride
- isAnyType → bool
-
Returns
trueif type isObjectordynamic.no setter - isBasicType → bool
-
Returns
trueif type isPrimitiveType or isCollection.no setter - isBigInt → bool
-
Returns
trueif type is BigInt.no setter - isBool → bool
-
Returns
trueif type isbool.no setter - isCollection → bool
-
Returns
trueif type is a collection (List, Iterable, Map or Set).no setter - isDateTime → bool
-
Returns
trueif type is DateTime.no setter - isDouble → bool
-
Returns
trueif type isdouble.no setter - isDuration → bool
-
Returns
trueif type is Duration.no setter - isDynamic → bool
-
Returns
trueif type isdynamic.no setter - isDynamicOrObject → bool
-
Returns
trueif type isdynamicorObject.no setter - isEntityReferenceBaseType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif type is equals to EntityReference OR EntityReferenceList.no setter - isEntityReferenceListType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif type is equals to EntityReferenceList.no setter - isEntityReferenceType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif type is equals to EntityReference.no setter - isEntityType → bool
-
Returns
trueif type can be an entity (![isDynamicOrObject] && ![isBasicType]).no setter - isFuture → bool
-
Returns
trueif type is a Future.no setter - isFutureOr → bool
-
Returns
trueif type is a FutureOr.no setter - isInt → bool
-
Returns
trueif type isint.no setter - isIterable → bool
-
Returns
trueif type is a Iterable.no setter - isList → bool
-
Returns
trueif type is a List.no setter - isListEntity → bool
-
Returns
trueif type is a List of entities.no setter - isListEntityOrReference → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif isListEntity OR isEntityReferenceListType.no setter - isMap → bool
-
Returns
trueif type is a Map.no setter - isMapEntry → bool
-
Returns
trueif type is a MapEntry.no setter - isNum → bool
-
Returns
trueif type isnum.no setter - isNumber → bool
-
Returns
trueif type isint,doubleornum.no setter - isObject → bool
-
Returns
trueif type isObject.no setter - isPrimitiveOrDynamicOrObjectType → bool
-
Returns
trueif type isPrimitiveType or isDynamicOrObject.no setter - isPrimitiveType → bool
-
Returns
trueif type is primitive (bool, int, double, num or String).no setter - isSet → bool
-
Returns
trueif type is a Set.no setter - isString → bool
-
Returns
trueif type isString.no setter - isUInt8List → bool
-
Returns
trueif type is Uint8List.no setter - isValidEntityReferenceListType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif isEntityReferenceListType and arguments0 is a valid entity type.no setter - isValidEntityReferenceType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif isEntityReferenceType and arguments0 is a valid entity type.no setter - isValidGenericType → bool
-
Returns
trueif genericType matches type.no setter - isValidListEntityOrReferenceType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif isListEntityOrReference AND EntityHandler.isValidEntityType for the entity type (argumentType0).no setter - isValidListEntityType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrueif isListEntity AND EntityHandler.isValidEntityType for the entity type (argumentType0).no setter - isVoid → bool
-
Returns
trueif type isvoid.no setter - listEntityOrReferenceType → TypeInfo?
-
Available on TypeInfo<
Returns the entity TypeInfo if isListEntityOrReference.T> , provided by the TypeInfoEntityExtension extensionno setter - listEntityType → TypeInfo?
-
The TypeInfo of the List elements type.
no setter
-
parser
→ TypeElementParser<
T> ? -
Returns the type parser.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → Type
-
The main Type.
no setter
- typeName → String
-
Returns the type name.
no setter
Methods
-
argumentParser<
A> (int index) → TypeElementParser< A> ? -
Returns the parser of the argument at
index. -
argumentType(
int index) → TypeInfo? -
Returns the TypeInfo of the argument at
index. -
callCasted<
R> (R f< E>() ) → R -
Calls
fcastingT. -
callCastedArgumentA<
R, A> (R f< A>() ) → R -
Calls
fcastingAas arguments0T. -
callCastedArgumentsAB<
R, A, B> (R f< A, B>() ) → R -
Calls
fcastingAas arguments0TandBas arguments1T. -
castCollection(
Object o, {bool nullable = false}) → Object -
Casts
oto this collection type if a ClassReflection or EnumReflection for it is registered at ReflectionFactory. -
castIterable(
Iterable itr, {bool nullable = false}) → Iterable -
Casts
itrto this type (Iterable<T>) if a ClassReflection or EnumReflection forTis registered at ReflectionFactory. -
castList(
List list, {bool nullable = false}) → List -
Casts
listto this type (List<T>) if a ClassReflection or EnumReflection forTis registered at ReflectionFactory. -
castMap(
Map map, {bool nullable = false}) → Map -
Casts
mapto this type (Map<K,V>), resolving the casting forKandVif there's a ClassReflection or EnumReflection for them registered at ReflectionFactory. -
castSet(
Set set, {bool nullable = false}) → Set -
Casts
setto this type (Set<T>) if a ClassReflection or EnumReflection forTis registered at ReflectionFactory. -
equalsArgumentsTypes(
List< Object> types) → bool -
Returns
trueif arguments have equalstypes. -
equalsEntityType(
TypeInfo? other) → bool -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
equalsType(
TypeInfo? other) → bool -
Returns
trueifthis.type equals toother.type. -
equalsTypeAndArguments(
TypeInfo other) → bool -
Returns
trueif equalsType and equalsArgumentsTypes aretrue. -
equalsTypeOrEntityType(
TypeInfo? other) → bool -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
equivalentArgumentsTypes(
List< Object> types) → bool -
Returns
trueif arguments have equivalenttypes. -
fromJson(
dynamic json, {JsonDecoder? jsonDecoder, bool duplicatedEntitiesAsID = true, bool? autoResetEntityCache}) → Object? -
isCastedIterable(
Object? o) → bool -
Returns
trueifois aIterable<E>whereEis arguments0T. -
isCastedList(
Object? o) → bool -
Returns
trueifois aList<E>whereEis arguments0T. -
isCastedMap(
Object? o) → bool -
Returns
trueifois aMap<K,V>whereKis arguments0TandVis arguments1T. -
isCastedMapEntry(
Object? o) → bool -
Returns
trueifois aMapEntry<K,V>whereKis arguments0TandVis arguments1T. -
isCastedSet(
Object? o) → bool -
Returns
trueifois aSet<E>whereEis arguments0T. -
isEquivalent(
TypeInfo other) → bool - Checks for equivalence, if the instances are similar:
-
isOf(
Type type, [List< Object> ? arguments]) → bool -
Returns
trueif this instances has the sametypeandarguments. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse<
V> (Object? value, [V? def]) → V? -
Parse
valueor returndef. -
parseEntity<
E> (Object? value) → E? -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
parseTraversingFuture<
V> (Object? value, [V? def]) → V? -
Same as parse but if
thisisFuture it will traverse to the Future argument. -
resolveValue<
V> (Object? value, {EntityHandler< T> ? entityHandler, EntityProvider? entityProvider, EntityHandlerProvider? entityHandlerProvider, EntityFetcher<T> ? entityFetcher, EntityCache? entityCache}) → V? -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
toCastedList<
E> (Object? val) → List< E> ? -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
toEntityReference(
Object? o, {Type? type, String? typeName, EntityHandler< T> ? entityHandler, EntityProvider? entityProvider, EntityHandlerProvider? entityHandlerProvider, EntityFetcher<T> ? entityFetcher, EntityCache? entityCache}) → EntityReference<T> -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
toEntityReferenceList(
Object? o, {Type? type, String? typeName, EntityHandler< T> ? entityHandler, EntityProvider? entityProvider, EntityHandlerProvider? entityHandlerProvider, EntitiesFetcher<T> ? entitiesFetcher, EntityFetcher<T> ? entityFetcher, EntityCache? entityCache}) → EntityReferenceList<T> -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
toIterableType(
) → TypeInfo< Iterable< T> > -
Returns
thisas a TypeInfo forIterable<T>. -
toListType(
) → TypeInfo< List< T> > -
Returns
thisas a TypeInfo forList<T>. -
toMapEntryKeyType<
V> ({TypeInfo? valueType}) → TypeInfo< MapEntry< T, V> > -
Returns
thisas a TypeInfo forMapEntry<T,V>. -
toMapEntryType<
V> (TypeInfo valueType) → TypeInfo< MapEntry< T, V> > -
Returns
thisas a TypeInfo forMapEntry<T,V>ensuring thatVis the same asvalueType. -
toMapEntryValueType<
K> ({TypeInfo? keyType}) → TypeInfo< MapEntry< K, T> > -
Returns
thisas a TypeInfo forMapEntry<K,T>. -
toMapKeyType<
V> ({TypeInfo? valueType}) → TypeInfo< Map< T, V> > -
Returns
thisas a TypeInfo forMap<T,V>. -
toMapType<
V> (TypeInfo valueType) → TypeInfo< Map< T, V> > -
Returns
thisas a TypeInfo forMap<T,V>ensuring thatVis the same asvalueType. -
toMapValueType<
K> ({TypeInfo? keyType}) → TypeInfo< Map< K, T> > -
Returns
thisas a TypeInfo forMap<K,T>. -
toSetType(
) → TypeInfo< Set< T> > -
Returns
thisas a TypeInfo forSet<T>. -
toString(
{bool withT = true}) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
Checks for equality,
othershould be exactly the same.override
Static Methods
-
accepts<
T> (Type type) → bool -
Returns
trueifTaccepts a value oftype. -
equalsTypeInfoList(
List< TypeInfo> a, List<TypeInfo> b) → bool -
Returns
trueif List of TypeInfoais equals tob. -
equalsTypeList(
List< Type> a, List<Type> b) → bool -
Returns
trueif List of Typeais equals tob. -
equivalentTypeInfoList(
List< TypeInfo> a, List<TypeInfo> b) → bool -
Returns
trueif List of TypeInfoais equivalent tob. -
equivalentTypeList(
List< Type> a, List<Type> b) → bool -
Returns
trueif List of Typeais equivalent tob. -
isPrimitiveTypeFor(
Type type) → bool -
removeTypeGenerics(
String type) → String - Removes generics from the type or record type string.
-
toList(
Iterable< Object> list, {bool growable = false}) → List<TypeInfo> -
Converts
listto a List of TypeInfo.
Constants
-
tBigInt
→ const TypeInfo<
BigInt> -
tBool
→ const TypeInfo<
bool> -
tDateTime
→ const TypeInfo<
DateTime> -
tDouble
→ const TypeInfo<
double> -
tDuration
→ const TypeInfo<
Duration> - tDynamic → const TypeInfo
-
tFunction
→ const TypeInfo<
Function> -
tFuture
→ const TypeInfo<
Future> -
tFutureOr
→ const TypeInfo<
FutureOr> -
tInt
→ const TypeInfo<
int> -
tIterable
→ const TypeInfo<
Iterable> -
tList
→ const TypeInfo<
List> -
tMap
→ const TypeInfo<
Map> -
tMapEntry
→ const TypeInfo<
Map> -
tNum
→ const TypeInfo<
num> -
tObject
→ const TypeInfo<
Object> -
tSet
→ const TypeInfo<
Set> -
tString
→ const TypeInfo<
String> -
tUint8List
→ const TypeInfo<
Uint8List>