- java.lang.Object
-
- org.eclipse.jetty.util.Index.Builder<V>
-
- Type Parameters:
V- the entry type
- Direct Known Subclasses:
Index.Mutable.Builder
public static class Index.Builder<V> extends java.lang.ObjectBuilder ofIndexinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Create a new index builder instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Index<V>build()Build aIndexinstance.Index.Builder<V>caseSensitive(boolean caseSensitive)Configure the index to be either case-sensitive or not.Index.Mutable.Builder<V>mutable()Configure the index to be mutable.java.lang.StringtoString()Index.Builder<V>with(java.lang.String key, V value)Configure a pre-existing entry.Index.Builder<V>with(V value)Configure a pre-existing entry with a key that is thetoString()representation of the value.Index.Builder<V>withAll(java.util.function.Supplier<java.util.Map<java.lang.String,V>> entriesSupplier)Configure some pre-existing entries.Index.Builder<V>withAll(V[] values, java.util.function.Function<V,java.lang.String> keyFunction)Configure some pre-existing entries.
-
-
-
Method Detail
-
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, java.util.function.Function<V,java.lang.String> keyFunction)
Configure some pre-existing entries.- Parameters:
values- an array of valueskeyFunction- aFunctionthat generates the key of each entry of the values array- Returns:
- this
-
withAll
public Index.Builder<V> withAll(java.util.function.Supplier<java.util.Map<java.lang.String,V>> entriesSupplier)
Configure some pre-existing entries.- Parameters:
entriesSupplier- aMapSupplierof entries- Returns:
- this
-
with
public Index.Builder<V> with(V value)
Configure a pre-existing entry with a key that is thetoString()representation of the value.- Parameters:
value- The value- Returns:
- this
-
with
public Index.Builder<V> with(java.lang.String key, V value)
Configure a pre-existing entry.- Parameters:
key- The keyvalue- 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.Builderconfigured like this builder.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-