Class Index.Builder<V>

java.lang.Object
org.eclipse.jetty.util.Index.Builder<V>
Type Parameters:
V - the entry type
Direct Known Subclasses:
Index.Mutable.Builder
Enclosing interface:
Index<V>

public static class Index.Builder<V> extends Object
Builder of Index instances.
  • Constructor Details

    • Builder

      public Builder()
      Create a new index builder instance.
  • Method Details

    • caseSensitive

      public Index.Builder<V> caseSensitive(boolean caseSensitive)
      Configure the index to be either case-sensitive or not. Default value is false.
      Parameters:
      caseSensitive - true if the index has to be case-sensitive
      Returns:
      this
    • withAll

      public Index.Builder<V> withAll(V[] values, Function<V,String> keyFunction)
      Configure some pre-existing entries.
      Parameters:
      values - an array of values
      keyFunction - a Function that generates the key of each entry of the values array
      Returns:
      this
    • withAll

      public Index.Builder<V> withAll(Supplier<Map<String,V>> entriesSupplier)
      Configure some pre-existing entries.
      Parameters:
      entriesSupplier - a Map Supplier of entries
      Returns:
      this
    • with

      public Index.Builder<V> with(V value)
      Configure a pre-existing entry with a key that is the toString() representation of the value.
      Parameters:
      value - The value
      Returns:
      this
    • with

      public Index.Builder<V> with(String key, V value)
      Configure a pre-existing entry.
      Parameters:
      key - The key
      value - The value for the key string
      Returns:
      this
    • mutable

      public Index.Mutable.Builder<V> mutable()
      Configure the index to be mutable.
      Returns:
      a Index.Mutable.Builder configured like this builder.
    • build

      public Index<V> build()
      Build a Index instance.
      Returns:
      a Index instance.
    • toString

      public String toString()
      Overrides:
      toString in class Object