Class VolumeSizeI
java.lang.Object
com.io7m.jregions.core.unparameterized.sizes.VolumeSizeI
- All Implemented Interfaces:
VolumeSizeIType,VolumeSizeValuesIType
public final class VolumeSizeI extends java.lang.Object implements VolumeSizeIType
The size of a volume with
int coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVolumeSizeI.BuilderBuilds instances of typeVolumeSizeI. -
Method Summary
Modifier and Type Method Description static VolumeSizeI.Builderbuilder()Creates a builder forVolumeSizeI.static VolumeSizeIcopyOf(VolumeSizeIType instance)Creates an immutable copy of aVolumeSizeITypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofVolumeSizeIthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY,sizeZ.static VolumeSizeIof(int sizeX, int sizeY, int sizeZ)Construct a new immutableVolumeSizeIinstance.intsizeX()intsizeY()intsizeZ()java.lang.StringtoString()Prints the immutable valueVolumeSizeIwith attribute values.VolumeSizeIwithSizeX(int value)Copy the current immutable object by setting a value for thesizeXattribute.VolumeSizeIwithSizeY(int value)Copy the current immutable object by setting a value for thesizeYattribute.VolumeSizeIwithSizeZ(int value)Copy the current immutable object by setting a value for thesizeZattribute.
-
Method Details
-
sizeX
public int sizeX()- Specified by:
sizeXin interfaceVolumeSizeIType- Specified by:
sizeXin interfaceVolumeSizeValuesIType- Returns:
- The value of the
sizeXattribute
-
sizeY
public int sizeY()- Specified by:
sizeYin interfaceVolumeSizeIType- Specified by:
sizeYin interfaceVolumeSizeValuesIType- Returns:
- The value of the
sizeYattribute
-
sizeZ
public int sizeZ()- Specified by:
sizeZin interfaceVolumeSizeIType- Specified by:
sizeZin interfaceVolumeSizeValuesIType- Returns:
- The value of the
sizeZattribute
-
withSizeX
Copy the current immutable object by setting a value for thesizeXattribute. A value equality check is 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. A value equality check is 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. A value equality check is 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 ofVolumeSizeIthat 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 valueVolumeSizeIwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutableVolumeSizeIinstance.- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattributesizeZ- The value for thesizeZattribute- Returns:
- An immutable VolumeSizeI instance
-
copyOf
Creates an immutable copy of aVolumeSizeITypevalue. 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 VolumeSizeI instance
-
builder
Creates a builder forVolumeSizeI.VolumeSizeI.builder() .setSizeX(int) // requiredsizeX.setSizeY(int) // requiredsizeY.setSizeZ(int) // requiredsizeZ.build();- Returns:
- A new VolumeSizeI builder
-