Class ImmutableAggregatePriceSet
- All Implemented Interfaces:
AggregatePriceSet
AggregatePriceSet.
Use the builder to create immutable instances:
ImmutableAggregatePriceSet.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableAggregatePriceSet. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableAggregatePriceSet.static ImmutableAggregatePriceSetcopyOf(AggregatePriceSet instance) Creates an immutable copy of aAggregatePriceSetvalue.booleanThis instance is equal to all instances ofImmutableAggregatePriceSetthat have equal attribute values.inthashCode()Computes a hash code from attributes:meanString,size,standardDeviationString.mean()The simple mean price as aBigDecimal.The simple mean price.com.google.common.primitives.UnsignedLongsize()The size of the data set to calculate the mean.The standard deviation as aBigDecimal.The standard deviation.toString()Prints the immutable valueAggregatePriceSetwith attribute values.withMeanString(String value) Copy the current immutable object by setting a value for themeanStringattribute.withSize(com.google.common.primitives.UnsignedLong value) Copy the current immutable object by setting a value for thesizeattribute.Copy the current immutable object by setting a value for thestandardDeviationStringattribute.
-
Method Details
-
meanString
The simple mean price.- Specified by:
meanStringin interfaceAggregatePriceSet- Returns:
- A
String.
-
size
public com.google.common.primitives.UnsignedLong size()The size of the data set to calculate the mean.- Specified by:
sizein interfaceAggregatePriceSet- Returns:
- An
UnsignedLong.
-
standardDeviationString
The standard deviation.- Specified by:
standardDeviationStringin interfaceAggregatePriceSet- Returns:
- A
String.
-
withMeanString
Copy the current immutable object by setting a value for themeanStringattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for meanString- Returns:
- A modified copy of the
thisobject
-
withSize
Copy the current immutable object by setting a value for thesizeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for size- Returns:
- A modified copy of the
thisobject
-
withStandardDeviationString
Copy the current immutable object by setting a value for thestandardDeviationStringattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for standardDeviationString- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableAggregatePriceSetthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:meanString,size,standardDeviationString. -
toString
Prints the immutable valueAggregatePriceSetwith attribute values. -
mean
The simple mean price as aBigDecimal.Returns a lazily initialized value of the
meanattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
meanin interfaceAggregatePriceSet- Returns:
- A lazily initialized value of the
meanattribute
-
standardDeviation
The standard deviation as aBigDecimal.Returns a lazily initialized value of the
standardDeviationattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
standardDeviationin interfaceAggregatePriceSet- Returns:
- A lazily initialized value of the
standardDeviationattribute
-
copyOf
Creates an immutable copy of aAggregatePriceSetvalue. 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 AggregatePriceSet instance
-
builder
Creates a builder forImmutableAggregatePriceSet.ImmutableAggregatePriceSet.builder() .meanString(String) // requiredmeanString.size(com.google.common.primitives.UnsignedLong) // requiredsize.standardDeviationString(String) // requiredstandardDeviationString.build();- Returns:
- A new ImmutableAggregatePriceSet builder
-