Package gui.page
Record Class PageEventHandler.HandlerMethod<T extends javafx.event.Event>
java.lang.Object
java.lang.Record
gui.page.PageEventHandler.HandlerMethod<T>
- Enclosing interface:
- PageEventHandler
public static record PageEventHandler.HandlerMethod<T extends javafx.event.Event>(javafx.event.EventType<T extends javafx.event.Event> eventType, javafx.event.EventHandler<? super T extends javafx.event.Event> eventHandler)
extends Record
Combination of an EventType and an EventHandler which handles events of
an appropriate type.
The type for this class looks intimidating, but its usage is fairly straightforward. Its purpose is simply to couple an EventType with an EventHandler so that they can easily be passed around together.
In the following example, a HandlerMethod is created which will accept all types of events and print them:
new HandlerMethod(Event.ANY, e -> System.out.println(e));
-
Constructor Summary
ConstructorDescriptionHandlerMethod
(javafx.event.EventType<T> eventType, javafx.event.EventHandler<? super T> eventHandler) Creates an instance of aHandlerMethod
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.javafx.event.EventHandler<? super T>
Returns the value of theeventHandler
record component.javafx.event.EventType<T>
Returns the value of theeventType
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
HandlerMethod
public HandlerMethod(javafx.event.EventType<T> eventType, javafx.event.EventHandler<? super T> eventHandler) Creates an instance of aHandlerMethod
record class.- Parameters:
eventType
- the value for theeventType
record componenteventHandler
- the value for theeventHandler
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
eventType
Returns the value of theeventType
record component.- Returns:
- the value of the
eventType
record component
-
eventHandler
Returns the value of theeventHandler
record component.- Returns:
- the value of the
eventHandler
record component
-