Kind<T> class
abstract
A class for creating, inspecting, and manipulating instances of specific
type T
.
Subclasses
- Booleans
- Integers
- Floating-point values
- Exact decimal values
- Date/time
- Sequences
- Collections
- Some others
- Custom entities
- Inheritance
- Implementers
Constructors
- Kind()
-
const
Properties
- bitsPerListElement → int
-
Number of bits per value or -1 if the number of bits undefined.
no setter
-
declaredExamples
→ List<
T> -
Returns declared examples of this value.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isSerializable → bool
-
no setter
- name → String
-
Name of this kind for debugging purposes.
no setter
- protobufFieldType → int
-
Returns package:protobuf
GeneratedMessage
field type.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getKind(
) → EntityKind< Object> -
Returns Kind of this entity.
inherited
-
instanceCast(
Object? value) → T -
Casts the value to
T
or throws an error. -
instanceIsCorrectType(
Object? value) → bool - Tells whether the argument is an instance of the wanted Dart type.
-
instanceIsDefaultValue(
Object? value) → bool - Tells whether the argument is a value returned by newInstance.
-
instanceIsValid(
Object? value) → bool - A shorthand for checking validity with instanceValidate.
-
instanceValidate(
ValidateContext context, Object? value) → void - Checks that the type is correct and then validates constraints with instanceValidateConstraints.
-
instanceValidateConstraints(
ValidateContext context, T value) → void - Validates that the argument matches constraints (minimum length, etc.).
-
instanceValidateOrThrow(
Object? value) → void - A shorthand for calling instanceValidate with the context ValidateContext.throwing().
-
jsonTreeDecode(
Object? value, {JsonDecodingContext? context}) → T -
Converts the argument (a JSON tree) into an instance of
T
. -
jsonTreeEncode(
T instance, {JsonEncodingContext? context}) → Object? - Converts the argument into a JSON tree.
-
newInstance(
) → T - Returns new default value.
-
newList(
int length, {bool growable = false, bool reactive = true}) → List< T> - Returns a new list of this kind, which is guaranteed some properties.
-
newListFrom(
Iterable< T> iterable, {bool growable = true, bool reactive = true}) → List<T> - A method similar to the list constructor List.from.
-
newListGenerate(
int length, T function(int i), {bool growable = false, bool reactive = true}) → List< T> - A method similar to the list constructor List.generate.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
protobufNewInstance(
) → Object? -
Constructs package:protobuf
GeneratedMessage
field value (e.g. bool, Int64,GeneratedMessage
). -
protobufTreeDecode(
Object? value, {ProtobufDecodingContext? context}) → T -
Converts the argument (a Protocol Buffers tree) into an instance of
T
. -
protobufTreeEncode(
T instance, {ProtobufEncodingContext? context}) → Object - Converts the argument into a Protocol Buffers tree.
-
randomExample(
{RandomExampleContext? context}) → T - Generates a random example.
-
randomExampleList(
int n, {RandomExampleContext? context}) → List< T> - Generates a list of N random examples (with randomExample).
-
toNonNullable(
) → Kind< T> - Returns a non-nullable version of this kind.
-
toNullable(
) → NullableKind< T> - Returns a nullable version of this kind.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited