Class PatternTopic

java.lang.Object
org.springframework.data.redis.listener.PatternTopic
All Implemented Interfaces:
Topic

public class PatternTopic extends Object implements Topic
Pattern topic (matching multiple channels).
Author:
Costin Leau, Mark Paluch, Christoph Strobl
  • Constructor Details

    • PatternTopic

      public PatternTopic(String pattern)
      Constructs a new PatternTopic instance.
      Parameters:
      pattern - must not be null.
  • Method Details

    • of

      public static PatternTopic of(String pattern)
      Create a new PatternTopic for channel subscriptions based on a pattern.
      Parameters:
      pattern - the channel pattern, must not be null or empty.
      Returns:
      the PatternTopic for pattern.
      Since:
      2.1
    • getTopic

      public String getTopic()
      Description copied from interface: Topic
      Returns the topic (as a String).
      Specified by:
      getTopic in interface Topic
      Returns:
      channel pattern.
    • toString

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

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

      public int hashCode()
      Overrides:
      hashCode in class Object