- java.lang.Object
-
- io.netty5.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(String name)
protected abstract T
newConstant(int id, String name)
T
newInstance(String name)
Creates a newConstant
for the givenname
or fail with anIllegalArgumentException
if aConstant
for the givenname
exists.int
nextId()
Deprecated.T
valueOf(Class<?> firstNameComponent, String secondNameComponent)
T
valueOf(String name)
Returns theConstant
which is assigned to the specifiedname
.
-
-
-
Method Detail
-
valueOf
public T valueOf(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(String name)
-
newInstance
public T newInstance(String name)
Creates a newConstant
for the givenname
or fail with anIllegalArgumentException
if aConstant
for the givenname
exists.
-
nextId
@Deprecated public final int nextId()
Deprecated.
-
-