Package liqp.filters

Class Filters

java.lang.Object
liqp.filters.Filters

public final class Filters extends Object
An immutable map of Filters.
  • Field Details

    • EMPTY

      public static final Filters EMPTY
    • DEFAULT_FILTERS

      public static Filters DEFAULT_FILTERS
    • JEKYLL_FILTERS

      public static Filters JEKYLL_FILTERS
  • Method Details

    • of

      public static Filters of(Collection<Filter> filters)
      Returns a Filters instance with the given filters.
      Parameters:
      filters - The filters to add.
    • of

      public static Filters of(Map<String,Filter> filters)
      Returns a Filters instance with the given filters.
      Parameters:
      filters - The filters to add.
    • of

      public static Filters of(Filter... filters)
      Returns Filters instance with the given filters.
      Parameters:
      filters - The filters to add.
    • getMap

      public Map<String,Filter> getMap()
      Returns the filters as an unmodifiable Map. The keys are the Filter.name.
      Returns:
      The map.
    • mergeWith

      public Filters mergeWith(Filters other)
      Returns a new Filters instance that combines this instance with the filters of the other instance. If there are filters with the same name in both instances, then the other filter takes precedence.
      Parameters:
      other - The other Filters instance.
      Returns:
      A new, merged instance.
    • mergeWith

      public Filters mergeWith(List<Filter> other)
      Returns a new Filters instance that combines this instance with the given filters. If there are filters with the same name in both instances, then the other filter takes precedence.
      Parameters:
      other - The other Filters instance.
      Returns:
      A new, merged instance.
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

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

      public Filter get(String name)
      Returns the Filter registered under the given name, or null if no such Filter exists in this Filters instance.
      Parameters:
      name - The name of the Filter.
      Returns:
      The instance.
    • values

      public Collection<Filter> values()
      Returns an unmodifiable collection of all Filters registered in this instance.
      Returns:
      The collection.