Package io.netty.util
Class Signal
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- io.netty.util.Signal
-
public final class Signal extends java.lang.Error implements Constant<Signal>
A specialError
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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Signal.SignalConstant
-
Field Summary
Fields Modifier and Type Field Description private Signal.SignalConstant
constant
private static ConstantPool<Signal>
pool
private static long
serialVersionUID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Signal other)
boolean
equals(java.lang.Object obj)
void
expect(Signal signal)
Check if the givenSignal
is the same as this instance.java.lang.Throwable
fillInStackTrace()
int
hashCode()
int
id()
Returns the unique number assigned to thisConstant
.java.lang.Throwable
initCause(java.lang.Throwable cause)
java.lang.String
name()
Returns the name of thisConstant
.java.lang.String
toString()
static Signal
valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
static Signal
valueOf(java.lang.String name)
Returns theSignal
of the specified name.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
pool
private static final ConstantPool<Signal> pool
-
constant
private final Signal.SignalConstant constant
-
-
Constructor Detail
-
Signal
private Signal(int id, java.lang.String name)
Creates a newSignal
with the specifiedname
.
-
-
Method Detail
-
valueOf
public static Signal valueOf(java.lang.String name)
Returns theSignal
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 givenSignal
is the same as this instance. If not anIllegalStateException
will be thrown.
-
initCause
public java.lang.Throwable initCause(java.lang.Throwable cause)
- Overrides:
initCause
in classjava.lang.Throwable
-
fillInStackTrace
public java.lang.Throwable fillInStackTrace()
- Overrides:
fillInStackTrace
in classjava.lang.Throwable
-
id
public int id()
Description copied from interface:Constant
Returns the unique number assigned to thisConstant
.
-
name
public java.lang.String name()
Description copied from interface:Constant
Returns the name of thisConstant
.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(Signal other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Signal>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Throwable
-
-