Record Class VectorWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.VectorWrapper
Class for wrapping a
Vector
.
Allows creation of a Vector
or BlockVector
.
-
Constructor Summary
ConstructorDescriptionVectorWrapper
(double xCoord, double yCoord, double zCoord) Creates an instance of aVectorWrapper
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static VectorWrapper
Create a newVectorWrapper
based on aVector
.Constructs a newBlockVector
based on wrapper values.Constructs a newVector
based on wrapper values.final String
toString()
Returns a string representation of this record class.double
xCoord()
Returns the value of thexCoord
record component.double
yCoord()
Returns the value of theyCoord
record component.double
zCoord()
Returns the value of thezCoord
record component.
-
Constructor Details
-
VectorWrapper
public VectorWrapper(double xCoord, double yCoord, double zCoord) Creates an instance of aVectorWrapper
record class.- Parameters:
xCoord
- the value for thexCoord
record componentyCoord
- the value for theyCoord
record componentzCoord
- the value for thezCoord
record component
-
-
Method Details
-
of
Create a newVectorWrapper
based on aVector
.- Parameters:
vector
- vector instance- Returns:
- new
VectorWrapper
instance
-
toBukkitVector
Constructs a newVector
based on wrapper values.- Returns:
- new
Vector
instance
-
toBukkitBlockVector
Constructs a newBlockVector
based on wrapper values.- Returns:
- new
BlockVector
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 with '=='. -
xCoord
public double xCoord()Returns the value of thexCoord
record component.- Returns:
- the value of the
xCoord
record component
-
yCoord
public double yCoord()Returns the value of theyCoord
record component.- Returns:
- the value of the
yCoord
record component
-
zCoord
public double zCoord()Returns the value of thezCoord
record component.- Returns:
- the value of the
zCoord
record component
-