Class PatternTopic

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

public class PatternTopic extends Object
Topic pattern matching multiple Redis channels.
Author:
Costin Leau, Mark Paluch, Christoph Strobl
  • Constructor Details

    • PatternTopic

      public PatternTopic(String channelPattern)
      Constructs a new PatternTopic instance.
      Parameters:
      channelPattern - 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 - pattern used to match channels; must not be null or empty.
      Returns:
      the PatternTopic for the given 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:
      the topic
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object