Int8Kind class

Kind for 8-bit signed integers.

Serialization

JSON

You can encode/decode JSON with jsonEncode and jsonDecode.

The JSON representation is JSON number.

Protocol Buffers / GRPC

Type int8 (variable-length unsigned integer) will be used.

See documentation of Protocol Buffers types at Protocol Buffers website.

Generating random values

You can generate random values with the methods randomExample() and randomExampleList().

If min and max are non-null, the random values will be in the range. Otherwise values are in some range near zero.

This behavior may be changed in future.

All available integer kinds

Inheritance
Annotations
  • @sealed

Constructors

Int8Kind({UnitOfMeasurement? unitOfMeasurement, int? min, int? max})
const

Properties

bitsPerListElement int
Number of bits per value or -1 if the number of bits undefined.
no setteroverride
declaredExamples List<int>
Returns declared examples of this value.
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
isSerializable bool
no setterinherited
max int?
Maximum valid value.
finalinherited
min int?
Minimum valid value.
finalinherited
name String
Name of this kind for debugging purposes.
no setteroverride
protobufFieldType int
Returns package:protobuf GeneratedMessage field type.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unitOfMeasurement UnitOfMeasurement?
Unit of measurement (for visualization purposes).
finalinherited
unsigned bool
Whether the kind is unsigned (Uint32Kind, etc.).
no setteroverride

Methods

getKind() EntityKind<Int8Kind>
Returns Kind of this entity.
override
instanceCast(Object? value) int
Casts the value to T or throws an error.
inherited
instanceIsCorrectType(Object? value) bool
Tells whether the argument is an instance of the wanted Dart type.
inherited
instanceIsDefaultValue(Object? value) bool
Tells whether the argument is a value returned by newInstance.
inherited
instanceIsValid(Object? value) bool
A shorthand for checking validity with instanceValidate.
inherited
instanceValidate(ValidateContext context, Object? value) → void
Checks that the type is correct and then validates constraints with instanceValidateConstraints.
inherited
instanceValidateConstraints(ValidateContext context, int value) → void
Validates that the argument matches constraints (minimum length, etc.).
override
instanceValidateOrThrow(Object? value) → void
A shorthand for calling instanceValidate with the context ValidateContext.throwing().
inherited
jsonTreeDecode(Object? value, {JsonDecodingContext? context}) int
Converts the argument (a JSON tree) into an instance of T.
inherited
jsonTreeEncode(int instance, {JsonEncodingContext? context}) Object?
Converts the argument into a JSON tree.
inherited
newInstance() int
Returns new default value.
inherited
newList(int length, {bool growable = false, bool reactive = true}) List<int>
Returns a new list of this kind, which is guaranteed some properties.
override
newListFrom(Iterable<int> iterable, {bool growable = true, bool reactive = true}) List<int>
A method similar to the list constructor List.from.
inherited
newListGenerate(int length, int function(int i), {bool growable = false, bool reactive = true}) List<int>
A method similar to the list constructor List.generate.
inherited
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).
inherited
protobufTreeDecode(Object? value, {ProtobufDecodingContext? context}) int
Converts the argument (a Protocol Buffers tree) into an instance of T.
inherited
protobufTreeEncode(int instance, {ProtobufEncodingContext? context}) int
Converts the argument into a Protocol Buffers tree.
inherited
randomExample({RandomExampleContext? context}) int
Generates a random example.
inherited
randomExampleList(int n, {RandomExampleContext? context}) List<int>
Generates a list of N random examples (with randomExample).
inherited
toNonNullable() Kind<int>
Returns a non-nullable version of this kind.
inherited
toNullable() NullableKind<int>
Returns a nullable version of this kind.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Properties

kind EntityKind<Int8Kind>
Kind for Int8Kind.
final

Constants

maxPossible → const int
Maximum possible value (2^7 - 1).
minPossible → const int
Minimum possible value (-(2^8)).