Record Class BoundingBoxWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.BoundingBoxWrapper
Class for wrapping a
BoundingBox
.-
Constructor Summary
ConstructorDescriptionBoundingBoxWrapper
(Vector corner1, Vector corner2) Creates an instance of aBoundingBoxWrapper
record class. -
Method Summary
Modifier and TypeMethodDescriptioncorner1()
Returns the value of thecorner1
record component.corner2()
Returns the value of thecorner2
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static BoundingBoxWrapper
of
(BoundingBox boundingBox) Create a newBoundingBoxWrapper
based on aBoundingBox
.Constructs a newBoundingBox
based on wrapper values.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
BoundingBoxWrapper
Creates an instance of aBoundingBoxWrapper
record class.- Parameters:
corner1
- the value for thecorner1
record componentcorner2
- the value for thecorner2
record component
-
-
Method Details
-
of
Create a newBoundingBoxWrapper
based on aBoundingBox
.- Parameters:
boundingBox
- bounding box instance- Returns:
- new
BoundingBoxWrapper
instance
-
toBukkitBoundingBox
Constructs a newBoundingBox
based on wrapper values.- Returns:
- new
BoundingBox
instance
-
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 thecorner1
record component.- Returns:
- the value of the
corner1
record component
-
corner2
Returns the value of thecorner2
record component.- Returns:
- the value of the
corner2
record component
-