Record Class BoundingBoxWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.BoundingBoxWrapper
Class for wrapping a
BoundingBox.-
Constructor Summary
ConstructorsConstructorDescriptionBoundingBoxWrapper(Vector corner1, Vector corner2) Creates an instance of aBoundingBoxWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncorner1()Returns the value of thecorner1record component.corner2()Returns the value of thecorner2record component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static BoundingBoxWrapperof(BoundingBox boundingBox) Create a newBoundingBoxWrapperbased on aBoundingBox.Constructs a newBoundingBoxbased on wrapper values.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BoundingBoxWrapper
Creates an instance of aBoundingBoxWrapperrecord class.- Parameters:
corner1- the value for thecorner1record componentcorner2- the value for thecorner2record component
-
-
Method Details
-
of
Create a newBoundingBoxWrapperbased on aBoundingBox.- Parameters:
boundingBox- bounding box instance- Returns:
- new
BoundingBoxWrapperinstance
-
toBukkitBoundingBox
Constructs a newBoundingBoxbased on wrapper values.- Returns:
- new
BoundingBoxinstance
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
corner1
Returns the value of thecorner1record component.- Returns:
- the value of the
corner1record component
-
corner2
Returns the value of thecorner2record component.- Returns:
- the value of the
corner2record component
-