Package io.github.ai4ci.abm
Class ImmutablePersonDemographic
java.lang.Object
io.github.ai4ci.abm.ImmutablePersonDemographic
- All Implemented Interfaces:
PersonDemographic
,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutablePersonDemographic
extends Object
implements PersonDemographic
Immutable implementation of
PersonDemographic
.
Use the builder to create immutable instances:
ImmutablePersonDemographic.builder()
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutablePersonDemographic
. -
Field Summary
Fields inherited from interface io.github.ai4ci.abm.PersonDemographic
DEFAULT
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutablePersonDemographic
.static ImmutablePersonDemographic
copyOf
(PersonDemographic instance) Creates an immutable copy of aPersonDemographic
value.boolean
This instance is equal to all instances ofImmutablePersonDemographic
that have equal attribute values.double
getAge()
int
hashCode()
Computes a hash code from attributes:age
.Creates a builder forImmutablePersonDemographic
.prefilled with attibute values ofthis
instance to easily create modified copies.toString()
Prints the immutable valuePersonDemographic
with attribute values.withAge
(double value) Copy the current immutable object by setting a value for theage
attribute.
-
Method Details
-
getAge
public double getAge()- Specified by:
getAge
in interfacePersonDemographic
- Returns:
- The value of the
age
attribute
-
withAge
Copy the current immutable object by setting a value for theage
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for age- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutablePersonDemographic
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:age
. -
toString
Prints the immutable valuePersonDemographic
with attribute values. -
copyOf
Creates an immutable copy of aPersonDemographic
value. 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 PersonDemographic instance
-
toBuilder
Creates a builder forImmutablePersonDemographic
.prefilled with attibute values ofthis
instance to easily create modified copies.- Returns:
- A new ImmutablePersonDemographic builder with attributes of
this
instance
-
builder
Creates a builder forImmutablePersonDemographic
.ImmutablePersonDemographic.builder() .setAge(double) // optional
age
.build();- Returns:
- A new ImmutablePersonDemographic builder
-