Record Class RayCaster.Result<O>

java.lang.Object
java.lang.Record
dev.cerus.maps.raycast.RayCaster.Result<O>
Type Parameters:
O - The type of the obstruction
Record Components:
lengthTravelled - The total length that the ray has travelled
length - The length that the ray was supposed to travel
points - The individual points of the ray cast
stoppedAt - The point where the ray has stopped at
hitObstruction - The obstruction that the ray has hit
forceStop - Whether the ray was forced to stop by an obstruction or not
Enclosing class:
RayCaster

public static record RayCaster.Result<O>(double lengthTravelled, double length, List<org.bukkit.Location> points, org.bukkit.Location stoppedAt, O hitObstruction, boolean forceStop) extends Record
Result of a ray cast operation
  • Constructor Summary

    Constructors
    Constructor
    Description
    Result​(double lengthTravelled, double length, List<org.bukkit.Location> points, org.bukkit.Location stoppedAt, O hitObstruction, boolean forceStop)
    Creates an instance of a Result record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals​(Object o)
    Indicates whether some other object is "equal to" this one.
    boolean
    Returns the value of the forceStop record component.
    int
    Returns a hash code value for this object.
    Returns the value of the hitObstruction record component.
    double
    Returns the value of the length record component.
    double
    Returns the value of the lengthTravelled record component.
    List<org.bukkit.Location>
    Returns the value of the points record component.
    org.bukkit.Location
    Returns the value of the stoppedAt record component.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Result

      public Result(double lengthTravelled, double length, List<org.bukkit.Location> points, org.bukkit.Location stoppedAt, O hitObstruction, boolean forceStop)
      Creates an instance of a Result record class.
      Parameters:
      lengthTravelled - the value for the lengthTravelled record component
      length - the value for the length record component
      points - the value for the points record component
      stoppedAt - the value for the stoppedAt record component
      hitObstruction - the value for the hitObstruction record component
      forceStop - the value for the forceStop record component
  • Method Details

    • 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.
    • lengthTravelled

      public double lengthTravelled()
      Returns the value of the lengthTravelled record component.
      Returns:
      the value of the lengthTravelled record component
    • length

      public double length()
      Returns the value of the length record component.
      Returns:
      the value of the length record component
    • points

      public List<org.bukkit.Location> points()
      Returns the value of the points record component.
      Returns:
      the value of the points record component
    • stoppedAt

      public org.bukkit.Location stoppedAt()
      Returns the value of the stoppedAt record component.
      Returns:
      the value of the stoppedAt record component
    • hitObstruction

      public O hitObstruction()
      Returns the value of the hitObstruction record component.
      Returns:
      the value of the hitObstruction record component
    • forceStop

      public boolean forceStop()
      Returns the value of the forceStop record component.
      Returns:
      the value of the forceStop record component