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 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 a LocationWrapper record class.
      Parameters:
      uid - the value for the uid record component
      name - the value for the name record component
      xCoord - the value for the xCoord record component
      yCoord - the value for the yCoord record component
      zCoord - the value for the zCoord record component
      yaw - the value for the yaw record component
      pitch - the value for the pitch record component
  • Method Details

    • of

      public static LocationWrapper of(Location loc)
      Create a new LocationWrapper based on a Location.
      Parameters:
      loc - location instance
      Returns:
      new LocationWrapper instance
    • toBukkitLocation

      public Location toBukkitLocation()
      Constructs a new Location based on wrapper values.
      Returns:
      new Location instance
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uid

      @Nullable public @Nullable UUID uid()
      Returns the value of the uid record component.
      Returns:
      the value of the uid record component
    • name

      @Nullable public @Nullable String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • xCoord

      public double xCoord()
      Returns the value of the xCoord record component.
      Returns:
      the value of the xCoord record component
    • yCoord

      public double yCoord()
      Returns the value of the yCoord record component.
      Returns:
      the value of the yCoord record component
    • zCoord

      public double zCoord()
      Returns the value of the zCoord record component.
      Returns:
      the value of the zCoord record component
    • yaw

      public float yaw()
      Returns the value of the yaw record component.
      Returns:
      the value of the yaw record component
    • pitch

      public float pitch()
      Returns the value of the pitch record component.
      Returns:
      the value of the pitch record component