Class StaticValueIndexer

java.lang.Object
de.otto.synapse.messagestore.StaticValueIndexer
All Implemented Interfaces:
Indexer

@Beta public class StaticValueIndexer extends Object implements Indexer
An Indexer that is creating a single Index by setting the indexed value to some static text.
  • Constructor Details

    • StaticValueIndexer

      public StaticValueIndexer(Index index, String value)
      Creates a StaticValueIndexer.
      Parameters:
      index - the Index
      value - the static value that will be used to set the index
  • Method Details

    • getIndexes

      @Nonnull public com.google.common.collect.ImmutableSet<Index> getIndexes()
      Description copied from interface: Indexer
      Returns the indexes supported by this Indexer.
      Specified by:
      getIndexes in interface Indexer
      Returns:
      Set of Index instances
    • supports

      public boolean supports(@Nonnull Index index)
      Specified by:
      supports in interface Indexer
      Parameters:
      index - the Index
      Returns:
      true, if the Index is supported, false otherwise.
    • calc

      public String calc(@Nonnull Index index, @Nonnull MessageStoreEntry entry)
      Description copied from interface: Indexer
      Calculates the Index value from the message-store entry.
      Specified by:
      calc in interface Indexer
      Parameters:
      index - the Index
      entry - the MessageStoreEntry
      Returns:
      indexed value
    • index

      @Nonnull public MessageStoreEntry index(@Nonnull MessageStoreEntry entry)
      Specified by:
      index in interface Indexer