Package me.totalfreedom.event
Record Class EventSubscription<T extends FEvent>
java.lang.Object
java.lang.Record
me.totalfreedom.event.EventSubscription<T>
-
Constructor Summary
ConstructorsConstructorDescriptionEventSubscription(T event, Callback<T> callback) Creates an instance of aEventSubscriptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncallback()Returns the value of thecallbackrecord component.booleancancel()final booleanIndicates whether some other object is "equal to" this one.event()Returns the value of theeventrecord component.final inthashCode()Returns a hash code value for this object.booleanfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EventSubscription
Creates an instance of aEventSubscriptionrecord class.- Parameters:
event- the value for theeventrecord componentcallback- the value for thecallbackrecord component
-
-
Method Details
-
cancel
public boolean cancel() -
isCancelled
public boolean isCancelled() -
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 withObjects::equals(Object,Object). -
event
Returns the value of theeventrecord component.- Returns:
- the value of the
eventrecord component
-
callback
Returns the value of thecallbackrecord component.- Returns:
- the value of the
callbackrecord component
-