Class ListenerConfig

java.lang.Object
com.hazelcast.config.ListenerConfig

public class ListenerConfig extends Object
Contains the configuration for an EventListener. The configuration contains either the class name of the EventListener implementation, or the actual EventListener instance.
  • Field Details

    • className

      protected String className
    • implementation

      protected EventListener implementation
  • Constructor Details

    • ListenerConfig

      public ListenerConfig()
      Creates a ListenerConfig without className/implementation.
    • ListenerConfig

      public ListenerConfig(String className)
      Creates a ListenerConfig with the given className.
      Parameters:
      className - the name of the EventListener class
      Throws:
      IllegalArgumentException - if className is null or an empty String
    • ListenerConfig

      public ListenerConfig(EventListener implementation)
      Creates a ListenerConfig with the given implementation.
      Parameters:
      implementation - the implementation to use as EventListener
      Throws:
      IllegalArgumentException - if the implementation is null
    • ListenerConfig

      public ListenerConfig(ListenerConfig config)
  • Method Details

    • getClassName

      public String getClassName()
      Returns the name of the class of the EventListener. If no class is specified, null is returned.
      Returns:
      the class name of the EventListener
      See Also:
    • setClassName

      public ListenerConfig setClassName(@Nonnull String className)
      Sets the class name of the EventListener.

      If an implementation was set, it will be removed.

      Parameters:
      className - the name of the class of the EventListener
      Returns:
      the updated ListenerConfig
      Throws:
      IllegalArgumentException - if className is null or an empty String
      See Also:
    • getImplementation

      public EventListener getImplementation()
      Returns the EventListener implementation. If none has been specified, null is returned.
      Returns:
      the EventListener implementation
      See Also:
    • setImplementation

      public ListenerConfig setImplementation(EventListener implementation)
      Sets the EventListener implementation.

      If a className was set, it will be removed.

      Parameters:
      implementation - the EventListener implementation
      Returns:
      the updated ListenerConfig
      Throws:
      IllegalArgumentException - the implementation is null
      See Also:
    • isIncludeValue

      public boolean isIncludeValue()
    • isLocal

      public boolean isLocal()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object