NNField<T> class

A field that can't be null. If a null value is set to it, a default value will be used.

Constructors

NNField(T defaultValue, {bool deepHashcode = false, T filter(dynamic value)?, T resolver(T value)?})

Properties

asBool bool?
value as bool.
no setter
asDouble double?
value as double.
no setter
asInt int?
value as int.
no setter
asNum num?
value as num.
no setter
asString String
no setter
deepHashcode bool
If true, hashCode will use deepHashCode for calculation.
final
defaultValue → T
final
filter → T Function(dynamic value)?
Optional value filter to apply before set.
final
hashCode int
The hash code for this object.
no setteroverride
resolver → T Function(T value)?
Optional value to apply before get.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
The filed value as T.
getter/setter pair

Methods

decrement(Object? value) num?
Decrements: this.value - value
divide(dynamic value) num?
Divide: this.value / value
equals(Object? other) bool
Returns true if other is equals to this.value.
get() → T
Returns the current filed value.
increment(Object? value) num?
Increments: this.value + value
multiply(dynamic value) num?
Multiply: this.value * value
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set<V>(V? value) → void
Sets the field value.
toString() String
value as String.
override

Operators

operator *(Object? value) num
Operator *, using asNum for this.value and parseNum(value) for parameter.
operator +(Object? value) num
Operator +, using asNum for this.value and parseNum(value) for parameter.
operator -(Object? value) num
Operator -, using asNum for this.value and parseNum(value) for parameter.
operator /(Object? value) num
Operator /, using asNum for this.value and parseNum(value) for parameter.
operator <(num value) bool
Operator <, using asNum for this.value and parseNum(value) for parameter.
operator <=(num value) bool
Operator <=, using asNum for this.value and parseNum(value) for parameter.
operator ==(Object value) bool
Same as equals method.
override
operator >(num value) bool
Operator >, using asNum for this.value and parseNum(value) for parameter.
operator >=(num value) bool
Operator >=, using asNum for this.value and parseNum(value) for parameter.
operator ^(Object? value) num
Operator ^, using asInt for this.value and parseInt(value) for parameter.