Name class Null safety

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
Annotations

Constructors

Name(Either<ValueObjectFailure<String>, String> value)
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 since JsonSerializable demands for it. Always use Name.withValue(value) constructor
const
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.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
value Either<ValueObjectFailure<String>, String>
final

Methods

getValue() String
inherited
isValid() bool
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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