Package io.github.ai4ci.abm
Class ImmutableContact
java.lang.Object
io.github.ai4ci.abm.ImmutableContact
- All Implemented Interfaces:
Contact
,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableContact
extends Object
implements Contact
Immutable implementation of
Contact
.
Use the builder to create immutable instances:
ImmutableContact.builder()
.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableContact.Builder
builder()
Creates a builder forImmutableContact
.static ImmutableContact
Creates an immutable copy of aContact
value.boolean
This instance is equal to all instances ofImmutableContact
that have equal attribute values.int
int
int
hashCode()
Computes a hash code from attributes:detected
,participant1Id
,participant2Id
.boolean
Was a contact detected by a smart agentCreates a builder forImmutableContact
.prefilled with attibute values ofthis
instance to easily create modified copies.toString()
Prints the immutable valueContact
with attribute values.final ImmutableContact
withDetected
(boolean value) Copy the current immutable object by setting a value for thedetected
attribute.final ImmutableContact
withParticipant1Id
(int value) Copy the current immutable object by setting a value for theparticipant1Id
attribute.final ImmutableContact
withParticipant2Id
(int value) Copy the current immutable object by setting a value for theparticipant2Id
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.ai4ci.abm.Contact
getParticipant, getParticipant, getParticipant, getParticipantState
-
Method Details
-
isDetected
public boolean isDetected()Was a contact detected by a smart agent- Specified by:
isDetected
in interfaceContact
-
getParticipant1Id
public int getParticipant1Id()- Specified by:
getParticipant1Id
in interfaceContact
- Returns:
- The value of the
participant1Id
attribute
-
getParticipant2Id
public int getParticipant2Id()- Specified by:
getParticipant2Id
in interfaceContact
- Returns:
- The value of the
participant2Id
attribute
-
withDetected
Copy the current immutable object by setting a value for thedetected
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for detected- Returns:
- A modified copy of the
this
object
-
withParticipant1Id
Copy the current immutable object by setting a value for theparticipant1Id
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for participant1Id- Returns:
- A modified copy of the
this
object
-
withParticipant2Id
Copy the current immutable object by setting a value for theparticipant2Id
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for participant2Id- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableContact
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:detected
,participant1Id
,participant2Id
. -
toString
Prints the immutable valueContact
with attribute values. -
copyOf
Creates an immutable copy of aContact
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 Contact instance
-
toBuilder
Creates a builder forImmutableContact
.prefilled with attibute values ofthis
instance to easily create modified copies.- Returns:
- A new ImmutableContact builder with attributes of
this
instance
-
builder
Creates a builder forImmutableContact
.ImmutableContact.builder() .setDetected(boolean) // required
detected
.setParticipant1Id(int) // requiredparticipant1Id
.setParticipant2Id(int) // requiredparticipant2Id
.build();- Returns:
- A new ImmutableContact builder
-