Package org.apache.hc.core5.http.config
Class RegistryBuilder<I>
- java.lang.Object
-
- org.apache.hc.core5.http.config.RegistryBuilder<I>
-
- Type Parameters:
I- the type of Registry values.
public final class RegistryBuilder<I> extends java.lang.ObjectBuilder forRegistryinstances.- Since:
- 4.3
-
-
Constructor Summary
Constructors Constructor Description RegistryBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Registry<I>build()Creates a new Registry with the registered items.static <I> RegistryBuilder<I>create()Creates a new RegistryBuilder.RegistryBuilder<I>register(java.lang.String id, I item)Registers the given item for the given ID.java.lang.StringtoString()
-
-
-
Field Detail
-
items
private final java.util.Map<java.lang.String,I> items
-
-
Method Detail
-
create
public static <I> RegistryBuilder<I> create()
Creates a new RegistryBuilder.- Type Parameters:
I- the type of Registry values.- Returns:
- a new RegistryBuilder.
-
register
public RegistryBuilder<I> register(java.lang.String id, I item)
Registers the given item for the given ID.- Parameters:
id- The ID key, converted to lower-case.item- The item to register.- Returns:
- this instance.
-
build
public Registry<I> build()
Creates a new Registry with the registered items.- Returns:
- a new Registry with the registered items.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-