Package io.github.ai4ci.abm.inhost
Class ImmutableExposureModel
java.lang.Object
io.github.ai4ci.abm.inhost.ImmutableExposureModel
- All Implemented Interfaces:
ExposureModel
,Serializable
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableExposureModel
extends Object
implements ExposureModel
Immutable implementation of
ExposureModel
.
Use the builder to create immutable instances:
ImmutableExposureModel.builder()
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableExposureModel
.Nested classes/interfaces inherited from interface io.github.ai4ci.abm.inhost.ExposureModel
ExposureModel.BiPhasicLogistic
-
Field Summary
Fields inherited from interface io.github.ai4ci.abm.inhost.ExposureModel
MIN_IMMUNE_ACTIVITY
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableExposureModel
.static ImmutableExposureModel
copyOf
(ExposureModel instance) Creates an immutable copy of aExposureModel
value.boolean
This instance is equal to all instances ofImmutableExposureModel
that have equal attribute values.double
int
double
double
double
int
hashCode()
Computes a hash code from attributes:exposureTime
,normalisedExposure
,immuneActivityAtExposure
,growthOffset
,decayOffset
.Creates a builder forImmutableExposureModel
.prefilled with attibute values ofthis
instance to easily create modified copies.toString()
Prints the immutable valueExposureModel
with attribute values.final ImmutableExposureModel
withDecayOffset
(double value) Copy the current immutable object by setting a value for thedecayOffset
attribute.final ImmutableExposureModel
withExposureTime
(int value) Copy the current immutable object by setting a value for theexposureTime
attribute.final ImmutableExposureModel
withGrowthOffset
(double value) Copy the current immutable object by setting a value for thegrowthOffset
attribute.final ImmutableExposureModel
withImmuneActivityAtExposure
(double value) Copy the current immutable object by setting a value for theimmuneActivityAtExposure
attribute.final ImmutableExposureModel
withNormalisedExposure
(double value) Copy the current immutable object by setting a value for thenormalisedExposure
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.ai4ci.abm.inhost.ExposureModel
getExposureImmuneActivity, getExposureViralLoad, isIrrelevant
-
Method Details
-
getExposureTime
public int getExposureTime()- Specified by:
getExposureTime
in interfaceExposureModel
- Returns:
- The value of the
exposureTime
attribute
-
getNormalisedExposure
public double getNormalisedExposure()- Specified by:
getNormalisedExposure
in interfaceExposureModel
- Returns:
- The value of the
normalisedExposure
attribute
-
getImmuneActivityAtExposure
public double getImmuneActivityAtExposure()- Specified by:
getImmuneActivityAtExposure
in interfaceExposureModel
- Returns:
- The value of the
immuneActivityAtExposure
attribute
-
getGrowthOffset
public double getGrowthOffset()- Specified by:
getGrowthOffset
in interfaceExposureModel
- Returns:
- The value of the
growthOffset
attribute
-
getDecayOffset
public double getDecayOffset()- Specified by:
getDecayOffset
in interfaceExposureModel
- Returns:
- The value of the
decayOffset
attribute
-
withExposureTime
Copy the current immutable object by setting a value for theexposureTime
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for exposureTime- Returns:
- A modified copy of the
this
object
-
withNormalisedExposure
Copy the current immutable object by setting a value for thenormalisedExposure
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for normalisedExposure- Returns:
- A modified copy of the
this
object
-
withImmuneActivityAtExposure
Copy the current immutable object by setting a value for theimmuneActivityAtExposure
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for immuneActivityAtExposure- Returns:
- A modified copy of the
this
object
-
withGrowthOffset
Copy the current immutable object by setting a value for thegrowthOffset
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for growthOffset- Returns:
- A modified copy of the
this
object
-
withDecayOffset
Copy the current immutable object by setting a value for thedecayOffset
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for decayOffset- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableExposureModel
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:exposureTime
,normalisedExposure
,immuneActivityAtExposure
,growthOffset
,decayOffset
. -
toString
Prints the immutable valueExposureModel
with attribute values. -
copyOf
Creates an immutable copy of aExposureModel
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 ExposureModel instance
-
toBuilder
Creates a builder forImmutableExposureModel
.prefilled with attibute values ofthis
instance to easily create modified copies.- Returns:
- A new ImmutableExposureModel builder with attributes of
this
instance
-
builder
Creates a builder forImmutableExposureModel
.ImmutableExposureModel.builder() .setExposureTime(int) // required
exposureTime
.setNormalisedExposure(double) // requirednormalisedExposure
.setImmuneActivityAtExposure(double) // requiredimmuneActivityAtExposure
.setGrowthOffset(double) // requiredgrowthOffset
.setDecayOffset(double) // requireddecayOffset
.build();- Returns:
- A new ImmutableExposureModel builder
-