FullName class

The core component of this utility.

This component is comprised of five entities that make it easy to handle a full name set: prefix, first name, middle name, last name, and suffix.

This class is intended for internal processes. However, it is understandable that it might be needed at some point for additional purposes. For this reason, it's made available.

It is recommended to avoid using this class unless it is highly necessary or a custom parser is used for uncommon use cases. This utility tries to cover as many use cases as possible.

To harness Dart cascade features, a good use of it may look like this:

var fullName = FullName()
    ..rawPrefix('Mr')
    ..rawFirstName('John')
    ..rawMiddleName(['Ben', 'Carl'])
    ..rawLastName('Smith')
    ..rawSuffix('Ph.D');

Additionally, an optional Configuration can be used to indicate some specific behaviors related to that name handling.

Constructors

FullName({Config? config})
Creates a full name as it goes.
FullName.fromJson(Map<String, String> jsonName, {Config? config})
Creates a full name json-like string content.
FullName.raw({String? prefix, required String firstName, List<String>? middleName, required String lastName, String? suffix, Config? config})
Creates a full name from raw string content.

Properties

config Config
A snapshot of the configuration used to set up this full name.
no setter
firstName FirstName
The first name part of the full name.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
lastName LastName
The last name part of the full name.
getter/setter pair
middleName List<Name>
The middle name part of the full name.
getter/setter pair
prefix Name?
The prefix part of the full name.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suffix Name?
The suffix part of the full name.
getter/setter pair

Methods

has(Namon namon) bool
Returns true if a namon has been set.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rawFirstName(String namon, {List<String>? more}) → void
Sets a firstName using string values.
rawLastName(String father, {String? mother, Surname? format}) → void
Sets a lastName using string values.
rawMiddleName(List<String> names) → void
Sets a middleName using string values.
rawPrefix(String namon) → void
Sets a prefix using string values.
rawSuffix(String namon) → void
Sets a suffix using string values.
toIterable() Iterable<Name>
Returns an Iterable of existing Names.
toString() String
A string representation of this object.
inherited

Operators

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