Package w.geo.api
Class ImmutableCountry
java.lang.Object
w.geo.api.ImmutableCountry
- All Implemented Interfaces:
Country
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableCountry
extends Object
implements Country
Immutable implementation of
Country.
Use the builder to create immutable instances:
ImmutableCountry.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableCountry.Builderbuilder()Creates a builder forImmutableCountry.static ImmutableCountryCreates an immutable copy of aCountryvalue.booleanThis instance is equal to all instances ofImmutableCountrythat have equal attribute values.getName()inthashCode()Computes a hash code from attributes:name,isoCode.toString()Prints the immutable valueCountrywith attribute values.final ImmutableCountrywithIsoCode(String value) Copy the current immutable object by setting a value for theisoCodeattribute.final ImmutableCountryCopy the current immutable object by setting a value for thenameattribute.
-
Method Details
-
getName
-
getIsoCode
- Specified by:
getIsoCodein interfaceCountry- Returns:
- The value of the
isoCodeattribute
-
withName
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withIsoCode
Copy the current immutable object by setting a value for theisoCodeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isoCode- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableCountrythat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:name,isoCode. -
toString
Prints the immutable valueCountrywith attribute values. -
copyOf
Creates an immutable copy of aCountryvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Country instance
-
builder
Creates a builder forImmutableCountry.ImmutableCountry.builder() .name(String) // requiredname.isoCode(String) // requiredisoCode.build();- Returns:
- A new ImmutableCountry builder
-