Record Class Listeners.DefaultListenerWrapper

java.lang.Object
java.lang.Record
org.pdfsam.eventstudio.Listeners.DefaultListenerWrapper
All Implemented Interfaces:
Listeners.ListenerWrapper
Enclosing class:
Listeners

private static record Listeners.DefaultListenerWrapper(Listener wrapped) extends Record implements Listeners.ListenerWrapper
Listener wrapper around an explicitly defined Listener
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Listener
    The field for the wrapped record component.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Creates an instance of a DefaultListenerWrapper record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    void
     
    final String
    Returns a string representation of this record class.
    Returns the value of the wrapped record component.

    Methods inherited from class java.lang.Object

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

    • wrapped

      private final Listener wrapped
      The field for the wrapped record component.
  • Constructor Details

    • DefaultListenerWrapper

      private DefaultListenerWrapper(Listener wrapped)
      Creates an instance of a DefaultListenerWrapper record class.
      Parameters:
      wrapped - the value for the wrapped record component
  • Method Details

    • onEvent

      public void onEvent(Envelope event)
      Specified by:
      onEvent in interface Listeners.ListenerWrapper
    • equals

      public 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • 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
    • wrapped

      public Listener wrapped()
      Returns the value of the wrapped record component.
      Returns:
      the value of the wrapped record component