Class VolumeSizeI
java.lang.Object
com.io7m.jregions.core.unparameterized.sizes.VolumeSizeI
- All Implemented Interfaces:
VolumeSizeIType
,VolumeSizeValuesIType
The size of a volume with
int
coordinates.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic VolumeSizeI.Builder
builder()
Creates a builder forVolumeSizeI
.static VolumeSizeI
copyOf
(VolumeSizeIType instance) Creates an immutable copy of aVolumeSizeIType
value.boolean
This instance is equal to all instances ofVolumeSizeI
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:sizeX
,sizeY
,sizeZ
.static VolumeSizeI
of
(int sizeX, int sizeY, int sizeZ) Construct a new immutableVolumeSizeI
instance.int
sizeX()
int
sizeY()
int
sizeZ()
toString()
Prints the immutable valueVolumeSizeI
with attribute values.final VolumeSizeI
withSizeX
(int value) Copy the current immutable object by setting a value for thesizeX
attribute.final VolumeSizeI
withSizeY
(int value) Copy the current immutable object by setting a value for thesizeY
attribute.final VolumeSizeI
withSizeZ
(int value) Copy the current immutable object by setting a value for thesizeZ
attribute.
-
Method Details
-
sizeX
public int sizeX()- Specified by:
sizeX
in interfaceVolumeSizeIType
- Specified by:
sizeX
in interfaceVolumeSizeValuesIType
- Returns:
- The value of the
sizeX
attribute
-
sizeY
public int sizeY()- Specified by:
sizeY
in interfaceVolumeSizeIType
- Specified by:
sizeY
in interfaceVolumeSizeValuesIType
- Returns:
- The value of the
sizeY
attribute
-
sizeZ
public int sizeZ()- Specified by:
sizeZ
in interfaceVolumeSizeIType
- Specified by:
sizeZ
in interfaceVolumeSizeValuesIType
- Returns:
- The value of the
sizeZ
attribute
-
withSizeX
Copy the current immutable object by setting a value for thesizeX
attribute. 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
this
object
-
withSizeY
Copy the current immutable object by setting a value for thesizeY
attribute. 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
this
object
-
withSizeZ
Copy the current immutable object by setting a value for thesizeZ
attribute. 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
this
object
-
equals
This instance is equal to all instances ofVolumeSizeI
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:sizeX
,sizeY
,sizeZ
. -
toString
Prints the immutable valueVolumeSizeI
with attribute values. -
of
Construct a new immutableVolumeSizeI
instance.- Parameters:
sizeX
- The value for thesizeX
attributesizeY
- The value for thesizeY
attributesizeZ
- The value for thesizeZ
attribute- Returns:
- An immutable VolumeSizeI instance
-
copyOf
Creates an immutable copy of aVolumeSizeIType
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 VolumeSizeI instance
-
builder
Creates a builder forVolumeSizeI
.VolumeSizeI.builder() .setSizeX(int) // required
sizeX
.setSizeY(int) // requiredsizeY
.setSizeZ(int) // requiredsizeZ
.build();- Returns:
- A new VolumeSizeI builder
-