Package io.netty.util
Class ConstantPool<T extends Constant<T>>
- java.lang.Object
-
- io.netty.util.ConstantPool<T>
-
-
Constructor Summary
Constructors Constructor Description ConstantPool()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
exists(java.lang.String name)
protected abstract T
newConstant(int id, java.lang.String name)
T
newInstance(java.lang.String name)
int
nextId()
Deprecated.T
valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
T
valueOf(java.lang.String name)
Returns theConstant
which is assigned to the specifiedname
.
-
-
-
Method Detail
-
valueOf
public T valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
-
valueOf
public T valueOf(java.lang.String name)
Returns theConstant
which is assigned to the specifiedname
. If there's no suchConstant
, a new one will be created and returned. Once created, the subsequent calls with the samename
will always return the previously created one (i.e. singleton.)- Parameters:
name
- the name of theConstant
-
exists
public boolean exists(java.lang.String name)
-
newInstance
public T newInstance(java.lang.String name)
-
newConstant
protected abstract T newConstant(int id, java.lang.String name)
-
nextId
@Deprecated public final int nextId()
Deprecated.
-
-