Class PVolumeSizeBD<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PVolumeSizeBD<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the volume
- All Implemented Interfaces:
PVolumeSizeBDType<S>,VolumeSizeValuesBDType
public final class PVolumeSizeBD<S> extends java.lang.Object implements PVolumeSizeBDType<S>
The size of a volume with
BigDecimal coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPVolumeSizeBD.Builder<S>Builds instances of typePVolumeSizeBD. -
Method Summary
Modifier and Type Method Description static <S> PVolumeSizeBD.Builder<S>builder()Creates a builder forPVolumeSizeBD.static <S> PVolumeSizeBD<S>copyOf(PVolumeSizeBDType<S> instance)Creates an immutable copy of aPVolumeSizeBDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPVolumeSizeBDthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY,sizeZ.static <S> PVolumeSizeBD<S>of(java.math.BigDecimal sizeX, java.math.BigDecimal sizeY, java.math.BigDecimal sizeZ)Construct a new immutablePVolumeSizeBDinstance.java.math.BigDecimalsizeX()java.math.BigDecimalsizeY()java.math.BigDecimalsizeZ()java.lang.StringtoString()Prints the immutable valuePVolumeSizeBDwith attribute values.PVolumeSizeBD<S>withSizeX(java.math.BigDecimal value)Copy the current immutable object by setting a value for thesizeXattribute.PVolumeSizeBD<S>withSizeY(java.math.BigDecimal value)Copy the current immutable object by setting a value for thesizeYattribute.PVolumeSizeBD<S>withSizeZ(java.math.BigDecimal value)Copy the current immutable object by setting a value for thesizeZattribute.
-
Method Details
-
sizeX
public java.math.BigDecimal sizeX()- Specified by:
sizeXin interfacePVolumeSizeBDType<S>- Specified by:
sizeXin interfaceVolumeSizeValuesBDType- Returns:
- The value of the
sizeXattribute
-
sizeY
public java.math.BigDecimal sizeY()- Specified by:
sizeYin interfacePVolumeSizeBDType<S>- Specified by:
sizeYin interfaceVolumeSizeValuesBDType- Returns:
- The value of the
sizeYattribute
-
sizeZ
public java.math.BigDecimal sizeZ()- Specified by:
sizeZin interfacePVolumeSizeBDType<S>- Specified by:
sizeZin interfaceVolumeSizeValuesBDType- Returns:
- The value of the
sizeZattribute
-
withSizeX
Copy the current immutable object by setting a value for thesizeXattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeX- Returns:
- A modified copy of the
thisobject
-
withSizeY
Copy the current immutable object by setting a value for thesizeYattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeY- Returns:
- A modified copy of the
thisobject
-
withSizeZ
Copy the current immutable object by setting a value for thesizeZattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sizeZ- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofPVolumeSizeBDthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:sizeX,sizeY,sizeZ.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valuePVolumeSizeBDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static <S> PVolumeSizeBD<S> of(java.math.BigDecimal sizeX, java.math.BigDecimal sizeY, java.math.BigDecimal sizeZ)Construct a new immutablePVolumeSizeBDinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattributesizeZ- The value for thesizeZattribute- Returns:
- An immutable PVolumeSizeBD instance
-
copyOf
Creates an immutable copy of aPVolumeSizeBDTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
S- generic parameter S- Parameters:
instance- The instance to copy- Returns:
- A copied immutable PVolumeSizeBD instance
-
builder
Creates a builder forPVolumeSizeBD.PVolumeSizeBD.<S>builder() .setSizeX(java.math.BigDecimal) // requiredsizeX.setSizeY(java.math.BigDecimal) // requiredsizeY.setSizeZ(java.math.BigDecimal) // requiredsizeZ.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PVolumeSizeBD builder
-