Record Class LocationWrapper
java.lang.Object
java.lang.Record
de.eldoria.jacksonbukkit.entities.LocationWrapper
public record LocationWrapper(@Nullable UUID uid, @Nullable String name, double xCoord, double yCoord, double zCoord, float yaw, float pitch)
extends Record
Class for wrapping a
Location.-
Constructor Summary
ConstructorsConstructorDescriptionLocationWrapper(@Nullable UUID uid, @Nullable String name, double xCoord, double yCoord, double zCoord, float yaw, float pitch) Creates an instance of aLocationWrapperrecord 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.name()Returns the value of thenamerecord component.static LocationWrapperCreate a newLocationWrapperbased on aLocation.floatpitch()Returns the value of thepitchrecord component.Constructs a newLocationbased on wrapper values.final StringtoString()Returns a string representation of this record class.uid()Returns the value of theuidrecord component.doublexCoord()Returns the value of thexCoordrecord component.floatyaw()Returns the value of theyawrecord component.doubleyCoord()Returns the value of theyCoordrecord component.doublezCoord()Returns the value of thezCoordrecord component.
-
Constructor Details
-
LocationWrapper
public LocationWrapper(@Nullable @Nullable UUID uid, @Nullable @Nullable String name, double xCoord, double yCoord, double zCoord, float yaw, float pitch) Creates an instance of aLocationWrapperrecord class.- Parameters:
uid- the value for theuidrecord componentname- the value for thenamerecord componentxCoord- the value for thexCoordrecord componentyCoord- the value for theyCoordrecord componentzCoord- the value for thezCoordrecord componentyaw- the value for theyawrecord componentpitch- the value for thepitchrecord component
-
-
Method Details
-
of
Create a newLocationWrapperbased on aLocation.- Parameters:
loc- location instance- Returns:
- new
LocationWrapperinstance
-
toBukkitLocation
Constructs a newLocationbased on wrapper values.- Returns:
- new
Locationinstance
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
uid
Returns the value of theuidrecord component.- Returns:
- the value of the
uidrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
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
-
yaw
public float yaw()Returns the value of theyawrecord component.- Returns:
- the value of the
yawrecord component
-
pitch
public float pitch()Returns the value of thepitchrecord component.- Returns:
- the value of the
pitchrecord component
-