Name class
Name value object is a generic object that should be used to hold instances of names
A use case would be firstName
, or lastName
or userName
- Inheritance
-
- Object
- ValueObject<
String> - Name
- Annotations
-
- @JsonSerializable()
- @_NameConverter()
Constructors
-
Name(Either<
ValueObjectFailure< value)String> , String> -
Name is the default constructor of this class. It should
NOT
be used to create a new instance of Name. It's here solely for the purpose to satisfy the compiler sinceJsonSerializable
demands for it. Always use Name.withValue(value) constructorconst - Name.fromJson(String value)
-
factory
- Name.maybe({String? input})
-
Name.maybe is used when the name is optional. Example use case;
middleName
factory
- Name.titleCased({required String input})
-
Name.titleCased is used when the name to returned has to be titleCased
factory
- Name.withValue(String value)
-
Name constructor is used in instance when the name must be provided. Example useCase;
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
→ Either<
ValueObjectFailure< String> , String> -
final
Methods
-
getValue(
) → String -
inherited
-
isValid(
) → bool -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object o) → bool -
The equality operator.
inherited