- 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 booleanexists(String name)protected abstract TnewConstant(int id, String name)TnewInstance(String name)Creates a newConstantfor the givennameor fail with anIllegalArgumentExceptionif aConstantfor the givennameexists.intnextId()Deprecated.TvalueOf(Class<?> firstNameComponent, String secondNameComponent)TvalueOf(String name)Returns theConstantwhich is assigned to the specifiedname.
-
-
-
Method Detail
-
valueOf
public T valueOf(String name)
Returns theConstantwhich 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 samenamewill 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 newConstantfor the givennameor fail with anIllegalArgumentExceptionif aConstantfor the givennameexists.
-
nextId
@Deprecated public final int nextId()
Deprecated.
-
-