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
ConstructorDescriptionLocationWrapper
(@Nullable UUID uid, @Nullable String name, double xCoord, double yCoord, double zCoord, float yaw, float pitch) Creates an instance of aLocationWrapper
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.name()
Returns the value of thename
record component.static LocationWrapper
Create a newLocationWrapper
based on aLocation
.float
pitch()
Returns the value of thepitch
record component.Constructs a newLocation
based on wrapper values.final String
toString()
Returns a string representation of this record class.uid()
Returns the value of theuid
record component.double
xCoord()
Returns the value of thexCoord
record component.float
yaw()
Returns the value of theyaw
record component.double
yCoord()
Returns the value of theyCoord
record component.double
zCoord()
Returns the value of thezCoord
record 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 aLocationWrapper
record class.- Parameters:
uid
- the value for theuid
record componentname
- the value for thename
record componentxCoord
- the value for thexCoord
record componentyCoord
- the value for theyCoord
record componentzCoord
- the value for thezCoord
record componentyaw
- the value for theyaw
record componentpitch
- the value for thepitch
record component
-
-
Method Details
-
of
Create a newLocationWrapper
based on aLocation
.- Parameters:
loc
- location instance- Returns:
- new
LocationWrapper
instance
-
toBukkitLocation
Constructs a newLocation
based on wrapper values.- Returns:
- new
Location
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. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
uid
Returns the value of theuid
record component.- Returns:
- the value of the
uid
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
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
-
yaw
public float yaw()Returns the value of theyaw
record component.- Returns:
- the value of the
yaw
record component
-
pitch
public float pitch()Returns the value of thepitch
record component.- Returns:
- the value of the
pitch
record component
-