Package io.github.ai4ci.abm
Class ModifiablePerson
java.lang.Object
io.github.ai4ci.abm.Person
io.github.ai4ci.abm.ModifiablePerson
- All Implemented Interfaces:
Abstraction.Entity
,Abstraction.HistoricalStateProvider<PersonHistory>
,Serializable
@ParametersAreNonnullByDefault
@Generated({"Modifiables.generator","Person"})
@NotThreadSafe
public class ModifiablePerson
extends Person
A modifiable implementation of the
Person
type.
Use the constructor to create new modifiable instances. You may even extend this class to add some convenience methods, however most of the methods in this class are final to preserve safety and predictable invariants.
ModifiablePerson is not thread-safe
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllHistory
(Iterable<? extends PersonHistory> elements) Adds elements tohistory
list.addHistory
(PersonHistory element) Adds one element tohistory
list.final ModifiablePerson
addHistory
(PersonHistory... elements) Adds elements tohistory
list.clear()
Clears the object by setting all attributes to their initial values.from
(ModifiablePerson instance) Fill this modifiable instance with attribute values from the providedPerson
instance.Fill this modifiable instance with attribute values from the providedPerson
instance.final PersonBaseline
final PersonState
final PersonDemographic
final List<PersonHistory>
final Integer
getId()
final ModifiableOutbreak
final StateMachine
final boolean
Returnstrue
if the required attributebaseline
is set.final boolean
Returnstrue
if the required attributecurrentState
is set.final boolean
Returnstrue
if the required attributedemographic
is set.final boolean
Returnstrue
if the required attributeid
is set.final boolean
Returnstrue
if the required attributenextHistory
is set.final boolean
Returnstrue
if the required attributenextState
is set.final boolean
Returnstrue
if the required attributeoutbreak
is set.final boolean
Returnstrue
if the required attributestateMachine
is set.final boolean
Returnstrue
if all required attributes are set, indicating that the object is initialized.setBaseline
(PersonBaseline baseline) Assigns a value to thebaseline
attribute.setCurrentState
(PersonState currentState) Assigns a value to thecurrentState
attribute.setDemographic
(PersonDemographic demographic) Assigns a value to thedemographic
attribute.setHistory
(Iterable<? extends PersonHistory> elements) Sets or replaces all elements forhistory
list.Assigns a value to theid
attribute.setNextHistory
(Ephemeral<ImmutablePersonHistory.Builder> nextHistory) Assigns a value to thenextHistory
attribute.setNextState
(Ephemeral<ImmutablePersonState.Builder> nextState) Assigns a value to thenextState
attribute.setOutbreak
(Outbreak outbreak) Assigns a value to theoutbreak
attribute.setStateMachine
(StateMachine stateMachine) Assigns a value to thestateMachine
attribute.final ModifiablePerson
Reset an attribute to its initial value.final ModifiablePerson
Reset an attribute to its initial value.final ModifiablePerson
Reset an attribute to its initial value.final ModifiablePerson
unsetId()
Reset an attribute to its initial value.final ModifiablePerson
Reset an attribute to its initial value.final ModifiablePerson
Reset an attribute to its initial value.final ModifiablePerson
Reset an attribute to its initial value.final ModifiablePerson
Reset an attribute to its initial value.Methods inherited from class io.github.ai4ci.abm.Person
createPersonStub, equals, getCurrentHistory, getHilbertCoordinates, getUrn, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.ai4ci.abm.mechanics.Abstraction.Entity
getExperimentName, getExperimentReplica, getModelName, getModelReplica
Methods inherited from interface io.github.ai4ci.abm.mechanics.Abstraction.HistoricalStateProvider
getHistory, getHistoryEntry
-
Constructor Details
-
ModifiablePerson
public ModifiablePerson()
-
-
Method Details
-
getId
-
getOutbreak
- Specified by:
getOutbreak
in classPerson
- Returns:
- value of
outbreak
attribute
-
getBaseline
- Specified by:
getBaseline
in classPerson
- Returns:
- value of
baseline
attribute
-
getCurrentState
- Specified by:
getCurrentState
in classPerson
- Returns:
- value of
currentState
attribute
-
getDemographic
- Specified by:
getDemographic
in classPerson
- Returns:
- value of
demographic
attribute
-
getNextState
- Specified by:
getNextState
in classPerson
- Returns:
- value of
nextState
attribute
-
getNextHistory
- Specified by:
getNextHistory
in classPerson
- Returns:
- value of
nextHistory
attribute
-
getStateMachine
- Specified by:
getStateMachine
in classPerson
- Returns:
- value of
stateMachine
attribute
-
getHistory
- Specified by:
getHistory
in interfaceAbstraction.HistoricalStateProvider<PersonHistory>
- Specified by:
getHistory
in classPerson
- Returns:
- modifiable list
history
-
clear
Clears the object by setting all attributes to their initial values.- Returns:
this
for use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedPerson
instance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
for use in a chained invocation
-
from
Fill this modifiable instance with attribute values from the providedPerson
instance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values). Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
for use in a chained invocation
-
setId
Assigns a value to theid
attribute.- Parameters:
id
- The value for id- Returns:
this
for use in a chained invocation
-
setOutbreak
Assigns a value to theoutbreak
attribute.- Parameters:
outbreak
- The value for outbreak- Returns:
this
for use in a chained invocation
-
setBaseline
Assigns a value to thebaseline
attribute.- Parameters:
baseline
- The value for baseline- Returns:
this
for use in a chained invocation
-
setCurrentState
Assigns a value to thecurrentState
attribute.- Parameters:
currentState
- The value for currentState- Returns:
this
for use in a chained invocation
-
setDemographic
Assigns a value to thedemographic
attribute.- Parameters:
demographic
- The value for demographic- Returns:
this
for use in a chained invocation
-
setNextState
@CanIgnoreReturnValue public ModifiablePerson setNextState(Ephemeral<ImmutablePersonState.Builder> nextState) Assigns a value to thenextState
attribute.- Parameters:
nextState
- The value for nextState- Returns:
this
for use in a chained invocation
-
setNextHistory
@CanIgnoreReturnValue public ModifiablePerson setNextHistory(Ephemeral<ImmutablePersonHistory.Builder> nextHistory) Assigns a value to thenextHistory
attribute.- Parameters:
nextHistory
- The value for nextHistory- Returns:
this
for use in a chained invocation
-
setStateMachine
Assigns a value to thestateMachine
attribute.- Parameters:
stateMachine
- The value for stateMachine- Returns:
this
for use in a chained invocation
-
addHistory
Adds one element tohistory
list.- Parameters:
element
- The history element- Returns:
this
for use in a chained invocation
-
addHistory
Adds elements tohistory
list.- Parameters:
elements
- An array of history elements- Returns:
this
for use in a chained invocation
-
setHistory
@CanIgnoreReturnValue public ModifiablePerson setHistory(Iterable<? extends PersonHistory> elements) Sets or replaces all elements forhistory
list.- Parameters:
elements
- An iterable of history elements- Returns:
this
for use in a chained invocation
-
addAllHistory
@CanIgnoreReturnValue public ModifiablePerson addAllHistory(Iterable<? extends PersonHistory> elements) Adds elements tohistory
list.- Parameters:
elements
- An iterable of history elements- Returns:
this
for use in a chained invocation
-
initialisedId
public final boolean initialisedId()Returnstrue
if the required attributeid
is set.- Returns:
true
if set
-
initialisedOutbreak
public final boolean initialisedOutbreak()Returnstrue
if the required attributeoutbreak
is set.- Returns:
true
if set
-
initialisedBaseline
public final boolean initialisedBaseline()Returnstrue
if the required attributebaseline
is set.- Returns:
true
if set
-
initialisedCurrentState
public final boolean initialisedCurrentState()Returnstrue
if the required attributecurrentState
is set.- Returns:
true
if set
-
initialisedDemographic
public final boolean initialisedDemographic()Returnstrue
if the required attributedemographic
is set.- Returns:
true
if set
-
initialisedNextState
public final boolean initialisedNextState()Returnstrue
if the required attributenextState
is set.- Returns:
true
if set
-
initialisedNextHistory
public final boolean initialisedNextHistory()Returnstrue
if the required attributenextHistory
is set.- Returns:
true
if set
-
initialisedStateMachine
public final boolean initialisedStateMachine()Returnstrue
if the required attributestateMachine
is set.- Returns:
true
if set
-
unsetId
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
unsetOutbreak
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
unsetBaseline
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
unsetCurrentState
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
unsetDemographic
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
unsetNextState
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
unsetNextHistory
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
unsetStateMachine
Reset an attribute to its initial value.- Returns:
this
for use in a chained invocation
-
isInitialized
public final boolean isInitialized()Returnstrue
if all required attributes are set, indicating that the object is initialized.- Returns:
true
if set
-