Record Class InteractionResult
java.lang.Object
java.lang.Record
nl.pim16aap2.lightkeeper.framework.InteractionResult
- Record Components:
eventFired- Whether a real Bukkit event was fired for the interaction. Block clicks always fire aPlayerInteractEvent; bypass-style operations (e.g. direct block sets) never do.cancelled- Whether a plugin cancelled the fired event. Alwaysfalsewhen no event was fired.
Outcome of a synthetic player interaction that fires a real, cancellable Bukkit event.
-
Constructor Summary
ConstructorsConstructorDescriptionInteractionResult(boolean eventFired, boolean cancelled) Creates an instance of aInteractionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecancelledrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theeventFiredrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InteractionResult
public InteractionResult(boolean eventFired, boolean cancelled) Creates an instance of aInteractionResultrecord class.- Parameters:
eventFired- the value for theeventFiredrecord componentcancelled- the value for thecancelledrecord 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. All components in this record class are compared with '=='. -
eventFired
public boolean eventFired()Returns the value of theeventFiredrecord component.- Returns:
- the value of the
eventFiredrecord component
-
cancelled
public boolean cancelled()Returns the value of thecancelledrecord component.- Returns:
- the value of the
cancelledrecord component
-