Class PAreaSizeBD<S>
java.lang.Object
com.io7m.jregions.core.parameterized.sizes.PAreaSizeBD<S>
- Type Parameters:
S- A phantom type parameter indicating the coordinate space of the area
- All Implemented Interfaces:
PAreaSizeBDType<S>,AreaSizeValuesBDType
public final class PAreaSizeBD<S> extends java.lang.Object implements PAreaSizeBDType<S>
The size of an area with
BigDecimal coordinates.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPAreaSizeBD.Builder<S>Builds instances of typePAreaSizeBD. -
Method Summary
Modifier and Type Method Description static <S> PAreaSizeBD.Builder<S>builder()Creates a builder forPAreaSizeBD.static <S> PAreaSizeBD<S>copyOf(PAreaSizeBDType<S> instance)Creates an immutable copy of aPAreaSizeBDTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofPAreaSizeBDthat have equal attribute values.inthashCode()Computes a hash code from attributes:sizeX,sizeY.java.math.BigDecimalheight()Deprecated.UsesizeY()static <S> PAreaSizeBD<S>of(java.math.BigDecimal sizeX, java.math.BigDecimal sizeY)Construct a new immutablePAreaSizeBDinstance.java.math.BigDecimalsizeX()java.math.BigDecimalsizeY()java.lang.StringtoString()Prints the immutable valuePAreaSizeBDwith attribute values.java.math.BigDecimalwidth()Deprecated.UsesizeX()PAreaSizeBD<S>withSizeX(java.math.BigDecimal value)Copy the current immutable object by setting a value for thesizeXattribute.PAreaSizeBD<S>withSizeY(java.math.BigDecimal value)Copy the current immutable object by setting a value for thesizeYattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jregions.core.parameterized.sizes.PAreaSizeBDType
checkPreconditions
-
Method Details
-
width
@Deprecated public java.math.BigDecimal width()Deprecated.UsesizeX()- Specified by:
widthin interfaceAreaSizeValuesBDType- Returns:
- The width of the area
-
height
@Deprecated public java.math.BigDecimal height()Deprecated.UsesizeY()- Specified by:
heightin interfaceAreaSizeValuesBDType- Returns:
- The height of the area
-
sizeX
public java.math.BigDecimal sizeX()- Specified by:
sizeXin interfaceAreaSizeValuesBDType- Specified by:
sizeXin interfacePAreaSizeBDType<S>- Returns:
- The value of the
sizeXattribute
-
sizeY
public java.math.BigDecimal sizeY()- Specified by:
sizeYin interfaceAreaSizeValuesBDType- Specified by:
sizeYin interfacePAreaSizeBDType<S>- Returns:
- The value of the
sizeYattribute
-
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
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofPAreaSizeBDthat 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.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valuePAreaSizeBDwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
Construct a new immutablePAreaSizeBDinstance.- Type Parameters:
S- generic parameter S- Parameters:
sizeX- The value for thesizeXattributesizeY- The value for thesizeYattribute- Returns:
- An immutable PAreaSizeBD instance
-
copyOf
Creates an immutable copy of aPAreaSizeBDTypevalue. 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 PAreaSizeBD instance
-
builder
Creates a builder forPAreaSizeBD.PAreaSizeBD.<S>builder() .setSizeX(java.math.BigDecimal) // requiredsizeX.setSizeY(java.math.BigDecimal) // requiredsizeY.build();- Type Parameters:
S- generic parameter S- Returns:
- A new PAreaSizeBD builder
-