Demonyms class final

A class that represents the demonyms for a particular language.

The Demonyms class is a simple value object that represents the demonyms for a particular language. It consists of a NaturalLanguage object that represents the language, and two String values that represent the demonym for females and males respectively. The female and male fields must not be empty.

Example usage:

final demonyms = Demonyms(
  language: LangEng(),
  female: 'Englishwoman',
  male: 'Englishman',
);
print(demonyms.female); // Output: 'Englishwoman'
print(demonyms.male); // Output: 'Englishman'
Implemented types
Available extensions

Constructors

Demonyms({required NaturalLanguage language, required String female, required String male})
Creates a new Demonyms object with the given language and demonym values.
const

Properties

areSame → bool

Available on Demonyms, provided by the DemonymsExtension extension

Returns true if the demonym for males and females is the same.
no setter
female → String
The demonym for females.
final
hashCode → int
The hash code for this object.
no setteroverride
language → NaturalLanguage
The natural language of this demonym.
final
male → String
The demonym for males.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({NaturalLanguage? language, String? female, String? male}) → Demonyms

Available on Demonyms, provided by the DemonymsExtension extension

Creates a copy of this object with the given fields replaced with the new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson({JsonCodec codec = const JsonCodec()}) → String
Returns a JSON-encoded string representation of the object.
override
toMap() → Map<String, String>

Available on Demonyms, provided by the DemonymsExtension extension

Converts this object object to a JSON like map.
toString({bool short = true}) → String
A string representation of this object.
override

Operators

operator ==(covariant Demonyms other) → bool
The equality operator.
override