Class AbstractConstant<T extends AbstractConstant<T>>

java.lang.Object
io.netty.util.AbstractConstant<T>
All Implemented Interfaces:
Constant<T>, java.lang.Comparable<T>
Direct Known Subclasses:
AttributeKey, ChannelOption, Signal.SignalConstant, SslContextOption

public abstract class AbstractConstant<T extends AbstractConstant<T>> extends java.lang.Object implements Constant<T>
Base implementation of Constant.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
     
    private final java.lang.String
     
    private static final java.util.concurrent.atomic.AtomicLong
     
    private final long
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractConstant(int id, java.lang.String name)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    final int
     
    final boolean
    equals(java.lang.Object obj)
     
    final int
     
    final int
    id()
    Returns the unique number assigned to this Constant.
    final java.lang.String
    Returns the name of this Constant.
    final java.lang.String
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • uniqueIdGenerator

      private static final java.util.concurrent.atomic.AtomicLong uniqueIdGenerator
    • id

      private final int id
    • name

      private final java.lang.String name
    • uniquifier

      private final long uniquifier
  • Constructor Details

    • AbstractConstant

      protected AbstractConstant(int id, java.lang.String name)
      Creates a new instance.
  • Method Details

    • name

      public final java.lang.String name()
      Description copied from interface: Constant
      Returns the name of this Constant.
      Specified by:
      name in interface Constant<T extends AbstractConstant<T>>
    • id

      public final int id()
      Description copied from interface: Constant
      Returns the unique number assigned to this Constant.
      Specified by:
      id in interface Constant<T extends AbstractConstant<T>>
    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • equals

      public final boolean equals(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • compareTo

      public final int compareTo(T o)
      Specified by:
      compareTo in interface java.lang.Comparable<T extends AbstractConstant<T>>