Class Signal

java.lang.Object
java.lang.Throwable
java.lang.Error
io.netty.util.Signal
All Implemented Interfaces:
Constant<Signal>, java.io.Serializable, java.lang.Comparable<Signal>

public final class Signal extends java.lang.Error implements Constant<Signal>
A special Error which is used to signal some state or request by throwing it. Signal has an empty stack trace and has no cause to save the instantiation overhead.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Signal.SignalConstant
     
    private static final ConstantPool<Signal>
     
    private static final long
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Signal(int id, java.lang.String name)
    Creates a new Signal with the specified name.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    boolean
    equals(java.lang.Object obj)
     
    void
    expect(Signal signal)
    Check if the given Signal is the same as this instance.
    java.lang.Throwable
     
    int
     
    int
    id()
    Returns the unique number assigned to this Constant.
    java.lang.Throwable
    initCause(java.lang.Throwable cause)
     
    java.lang.String
    Returns the name of this Constant.
    java.lang.String
     
    static Signal
    valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
    static Signal
    valueOf(java.lang.String name)
    Returns the Signal of the specified name.

    Methods inherited from class java.lang.Throwable

    addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • Signal

      private Signal(int id, java.lang.String name)
      Creates a new Signal with the specified name.
  • Method Details

    • valueOf

      public static Signal valueOf(java.lang.String name)
      Returns the Signal of the specified name.
    • valueOf

      public static Signal valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
    • expect

      public void expect(Signal signal)
      Check if the given Signal is the same as this instance. If not an IllegalStateException will be thrown.
    • initCause

      public java.lang.Throwable initCause(java.lang.Throwable cause)
      Overrides:
      initCause in class java.lang.Throwable
    • fillInStackTrace

      public java.lang.Throwable fillInStackTrace()
      Overrides:
      fillInStackTrace in class java.lang.Throwable
    • id

      public int id()
      Description copied from interface: Constant
      Returns the unique number assigned to this Constant.
      Specified by:
      id in interface Constant<Signal>
    • name

      public java.lang.String name()
      Description copied from interface: Constant
      Returns the name of this Constant.
      Specified by:
      name in interface Constant<Signal>
    • equals

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

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

      public int compareTo(Signal other)
      Specified by:
      compareTo in interface java.lang.Comparable<Signal>
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Throwable