TypeInfo<T> class
- Available extensions
Constructors
-
TypeInfo.new(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. If this TypeInfo is an EntityReference it will return the EntityReference.type. See EntityHandler.isValidEntityType.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
T
Type.no setter - hasArguments → bool
-
Returns
true
if type has arguments.no setter - hashCode → int
-
The hash code for this object.
no setteroverride
- isAnyType → bool
-
Returns
true
if type isObject
ordynamic
.no setter - isBasicType → bool
-
Returns
true
if type isPrimitiveType or isCollection.no setter - isBigInt → bool
-
Returns
true
if type is BigInt.no setter - isBool → bool
-
Returns
true
if type isbool
.no setter - isCollection → bool
-
Returns
true
if type is a collection (List, Iterable, Map or Set).no setter - isDateTime → bool
-
Returns
true
if type is DateTime.no setter - isDouble → bool
-
Returns
true
if type isdouble
.no setter - isDuration → bool
-
Returns
true
if type is Duration.no setter - isDynamic → bool
-
Returns
true
if type isdynamic
.no setter - isDynamicOrObject → bool
-
Returns
true
if type isdynamic
orObject
.no setter - isEntityReferenceBaseType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if type is equals to EntityReference OR EntityReferenceList.no setter - isEntityReferenceListType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if type is equals to EntityReferenceList.no setter - isEntityReferenceType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if type is equals to EntityReference.no setter - isEntityType → bool
-
Returns
true
if type can be an entity (![isDynamicOrObject] && ![isBasicType]).no setter - isFuture → bool
-
Returns
true
if type is a Future.no setter - isFutureOr → bool
-
Returns
true
if type is a FutureOr.no setter - isInt → bool
-
Returns
true
if type isint
.no setter - isIterable → bool
-
Returns
true
if type is a Iterable.no setter - isList → bool
-
Returns
true
if type is a List.no setter - isListEntity → bool
-
Returns
true
if type is a List of entities.no setter - isListEntityOrReference → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if isListEntity OR isEntityReferenceListType.no setter - isMap → bool
-
Returns
true
if type is a Map.no setter - isMapEntry → bool
-
Returns
true
if type is a MapEntry.no setter - isNum → bool
-
Returns
true
if type isnum
.no setter - isNumber → bool
-
Returns
true
if type isint
,double
ornum
.no setter - isObject → bool
-
Returns
true
if type isObject
.no setter - isPrimitiveOrDynamicOrObjectType → bool
-
Returns
true
if type isPrimitiveType or isDynamicOrObject.no setter - isPrimitiveType → bool
-
Returns
true
if type is primitive (bool, int, double, num or String).no setter - isSet → bool
-
Returns
true
if type is a Set.no setter - isString → bool
-
Returns
true
if type isString
.no setter - isUInt8List → bool
-
Returns
true
if type is Uint8List.no setter - isValidEntityReferenceListType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if isEntityReferenceListType and arguments0 is a valid entity type.no setter - isValidEntityReferenceType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if isEntityReferenceType and arguments0 is a valid entity type.no setter - isValidGenericType → bool
-
Returns
true
if genericType matches type.no setter - isValidListEntityOrReferenceType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if isListEntityOrReference AND EntityHandler.isValidEntityType for the entity type (argumentType0
).no setter - isValidListEntityType → bool
-
Available on TypeInfo<
ReturnsT> , provided by the TypeInfoEntityExtension extensiontrue
if isListEntity AND EntityHandler.isValidEntityType for the entity type (argumentType0
).no setter - isVoid → bool
-
Returns
true
if 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< T>() ) → R -
Calls
f
castingT
. -
callCastedArgumentA<
R, A> (R f< A>() ) → R -
Calls
f
castingA
as arguments0T
. -
callCastedArgumentsAB<
R, A, B> (R f< A, B>() ) → R -
Calls
f
castingA
as arguments0T
andB
as arguments1T
. -
castCollection(
Object o, {bool nullable = false}) → Object -
Casts
o
to this collection type if a ClassReflection or EnumReflection for it is registered at ReflectionFactory. -
castIterable(
Iterable itr, {bool nullable = false}) → Iterable -
Casts
itr
to this type (Iterable<T>
) if a ClassReflection or EnumReflection forT
is registered at ReflectionFactory. -
castList(
List list, {bool nullable = false}) → List -
Casts
list
to this type (List<T>
) if a ClassReflection or EnumReflection forT
is registered at ReflectionFactory. -
castMap(
Map map, {bool nullable = false}) → Map -
Casts
map
to this type (Map<K,V>
), resolving the casting forK
andV
if there's a ClassReflection or EnumReflection for them registered at ReflectionFactory. -
castSet(
Set set, {bool nullable = false}) → Set -
Casts
set
to this type (Set<T>
) if a ClassReflection or EnumReflection forT
is registered at ReflectionFactory. -
equalsArgumentsTypes(
List< Object> types) → bool -
Returns
true
if arguments have equalstypes
. -
equalsEntityType(
TypeInfo? other) → bool -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
equalsType(
TypeInfo? other) → bool -
Returns
true
ifthis
.type equals toother
.type. -
equalsTypeAndArguments(
TypeInfo other) → bool -
Returns
true
if equalsType and equalsArgumentsTypes aretrue
. -
equalsTypeOrEntityType(
TypeInfo? other) → bool -
Available on TypeInfo<
T> , provided by the TypeInfoEntityExtension extension -
equivalentArgumentsTypes(
List< Object> types) → bool -
Returns
true
if arguments have equivalenttypes
. -
fromJson(
dynamic json, {JsonDecoder? jsonDecoder, bool duplicatedEntitiesAsID = true, bool? autoResetEntityCache}) → Object? -
isCastedIterable(
Object? o) → bool -
Returns
true
ifo
is aIterable<E>
whereE
is arguments0T
. -
isCastedList(
Object? o) → bool -
Returns
true
ifo
is aList<E>
whereE
is arguments0T
. -
isCastedMap(
Object? o) → bool -
Returns
true
ifo
is aMap<K,V>
whereK
is arguments0T
andV
is arguments1T
. -
isCastedMapEntry(
Object? o) → bool -
Returns
true
ifo
is aMapEntry<K,V>
whereK
is arguments0T
andV
is arguments1T
. -
isCastedSet(
Object? o) → bool -
Returns
true
ifo
is aSet<E>
whereE
is arguments0T
. -
isEquivalent(
TypeInfo other) → bool - Checks for equivalence, if the instances are similar:
-
isOf(
Type type, [List< Object> ? arguments]) → bool -
Returns
true
if this instances has the sametype
andarguments
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse<
V> (Object? value, [V? def]) → V? -
Parse
value
or 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
this
isFuture 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 -
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
this
as a TypeInfo forIterable<T>
. -
toListType(
) → TypeInfo< List< T> > -
Returns
this
as a TypeInfo forList<T>
. -
toMapEntryKeyType<
V> ({TypeInfo? valueType}) → TypeInfo< MapEntry< T, V> > -
Returns
this
as a TypeInfo forMapEntry<T,V>
. -
toMapEntryType<
V> (TypeInfo valueType) → TypeInfo< MapEntry< T, V> > -
Returns
this
as a TypeInfo forMapEntry<T,V>
ensuring thatV
is the same asvalueType
. -
toMapEntryValueType<
K> ({TypeInfo? keyType}) → TypeInfo< MapEntry< K, T> > -
Returns
this
as a TypeInfo forMapEntry<K,T>
. -
toMapKeyType<
V> ({TypeInfo? valueType}) → TypeInfo< Map< T, V> > -
Returns
this
as a TypeInfo forMap<T,V>
. -
toMapType<
V> (TypeInfo valueType) → TypeInfo< Map< T, V> > -
Returns
this
as a TypeInfo forMap<T,V>
ensuring thatV
is the same asvalueType
. -
toMapValueType<
K> ({TypeInfo? keyType}) → TypeInfo< Map< K, T> > -
Returns
this
as a TypeInfo forMap<K,T>
. -
toSetType(
) → TypeInfo< Set< T> > -
Returns
this
as a TypeInfo forSet<T>
. -
toString(
{bool withT = true}) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
Checks for equality,
other
should be exactly the same.override
Static Methods
-
accepts<
T> (Type type) → bool -
Returns
true
ifT
accepts a value oftype
. -
equalsTypeInfoList(
List< TypeInfo> a, List<TypeInfo> b) → bool -
Returns
true
if List of TypeInfoa
is equals tob
. -
equalsTypeList(
List< Type> a, List<Type> b) → bool -
Returns
true
if List of Typea
is equals tob
. -
equivalentTypeInfoList(
List< TypeInfo> a, List<TypeInfo> b) → bool -
Returns
true
if List of TypeInfoa
is equivalent tob
. -
equivalentTypeList(
List< Type> a, List<Type> b) → bool -
Returns
true
if List of Typea
is 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
list
to 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
-
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>