Package dev.cerus.maps.raycast
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 travelledlength
- The length that the ray was supposed to travelpoints
- The individual points of the ray caststoppedAt
- The point where the ray has stopped athitObstruction
- The obstruction that the ray has hitforceStop
- 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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.boolean
Returns the value of theforceStop
record component.int
hashCode()
Returns a hash code value for this object.Returns the value of thehitObstruction
record component.double
length()
Returns the value of thelength
record component.double
Returns the value of thelengthTravelled
record component.List<org.bukkit.Location>
points()
Returns the value of thepoints
record component.org.bukkit.Location
Returns the value of thestoppedAt
record component.toString()
Returns a string representation of this record class.
-
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 aResult
record class.- Parameters:
lengthTravelled
- the value for thelengthTravelled
record componentlength
- the value for thelength
record componentpoints
- the value for thepoints
record componentstoppedAt
- the value for thestoppedAt
record componenthitObstruction
- the value for thehitObstruction
record componentforceStop
- the value for theforceStop
record component
-
-
Method Details
-
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 '=='. -
lengthTravelled
public double lengthTravelled()Returns the value of thelengthTravelled
record component.- Returns:
- the value of the
lengthTravelled
record component
-
length
public double length()Returns the value of thelength
record component.- Returns:
- the value of the
length
record component
-
points
Returns the value of thepoints
record component.- Returns:
- the value of the
points
record component
-
stoppedAt
public org.bukkit.Location stoppedAt()Returns the value of thestoppedAt
record component.- Returns:
- the value of the
stoppedAt
record component
-
hitObstruction
Returns the value of thehitObstruction
record component.- Returns:
- the value of the
hitObstruction
record component
-
forceStop
public boolean forceStop()Returns the value of theforceStop
record component.- Returns:
- the value of the
forceStop
record component
-