Package io.netty.util
Class AbstractConstant<T extends AbstractConstant<T>>
java.lang.Object
io.netty.util.AbstractConstant<T>
- All Implemented Interfaces:
Constant<T>
,Comparable<T>
- Direct Known Subclasses:
AttributeKey
,ChannelOption
,Signal.SignalConstant
,SslContextOption
public abstract class AbstractConstant<T extends AbstractConstant<T>>
extends Object
implements Constant<T>
Base implementation of
Constant
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final String
private static final AtomicLong
private final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractConstant
(int id, String name) Creates a new instance. -
Method Summary
-
Field Details
-
uniqueIdGenerator
-
id
private final int id -
name
-
uniquifier
private final long uniquifier
-
-
Constructor Details
-
AbstractConstant
Creates a new instance.
-
-
Method Details
-
name
Description copied from interface:Constant
Returns the name of thisConstant
.- Specified by:
name
in interfaceConstant<T extends AbstractConstant<T>>
-
id
public final int id()Description copied from interface:Constant
Returns the unique number assigned to thisConstant
.- Specified by:
id
in interfaceConstant<T extends AbstractConstant<T>>
-
toString
-
hashCode
public final int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T extends AbstractConstant<T>>
-