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
ConstructorsConstructorDescriptionVectorWrapper(double xCoord, double yCoord, double zCoord) Creates an instance of aVectorWrapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static VectorWrapperCreate a newVectorWrapperbased on aVector.Constructs a newBlockVectorbased on wrapper values.Constructs a newVectorbased on wrapper values.final StringtoString()Returns a string representation of this record class.doublexCoord()Returns the value of thexCoordrecord component.doubleyCoord()Returns the value of theyCoordrecord component.doublezCoord()Returns the value of thezCoordrecord component.
-
Constructor Details
-
VectorWrapper
public VectorWrapper(double xCoord, double yCoord, double zCoord) Creates an instance of aVectorWrapperrecord class.- Parameters:
xCoord- the value for thexCoordrecord componentyCoord- the value for theyCoordrecord componentzCoord- the value for thezCoordrecord component
-
-
Method Details
-
of
Create a newVectorWrapperbased on aVector.- Parameters:
vector- vector instance- Returns:
- new
VectorWrapperinstance
-
toBukkitVector
Constructs a newVectorbased on wrapper values.- Returns:
- new
Vectorinstance
-
toBukkitBlockVector
Constructs a newBlockVectorbased on wrapper values.- Returns:
- new
BlockVectorinstance
-
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 thexCoordrecord component.- Returns:
- the value of the
xCoordrecord component
-
yCoord
public double yCoord()Returns the value of theyCoordrecord component.- Returns:
- the value of the
yCoordrecord component
-
zCoord
public double zCoord()Returns the value of thezCoordrecord component.- Returns:
- the value of the
zCoordrecord component
-