public final class Signal extends java.lang.Error implements Constant<Signal>
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.Modifier and Type | Class and Description |
---|---|
private static class |
Signal.SignalConstant |
Modifier and Type | Field and Description |
---|---|
private Signal.SignalConstant |
constant |
private static ConstantPool<Signal> |
pool |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
private |
Signal(int id,
java.lang.String name)
Creates a new
Signal with the specified name . |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Signal other) |
boolean |
equals(java.lang.Object obj) |
void |
expect(Signal signal)
Check if the given
Signal is the same as this instance. |
java.lang.Throwable |
fillInStackTrace() |
int |
hashCode() |
int |
id()
Returns the unique number assigned to this
Constant . |
java.lang.Throwable |
initCause(java.lang.Throwable cause) |
java.lang.String |
name()
Returns the name of this
Constant . |
java.lang.String |
toString() |
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. |
private static final long serialVersionUID
private static final ConstantPool<Signal> pool
private final Signal.SignalConstant constant
private Signal(int id, java.lang.String name)
Signal
with the specified name
.public static Signal valueOf(java.lang.String name)
Signal
of the specified name.public static Signal valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
public void expect(Signal signal)
Signal
is the same as this instance. If not an IllegalStateException
will
be thrown.public java.lang.Throwable initCause(java.lang.Throwable cause)
initCause
in class java.lang.Throwable
public java.lang.Throwable fillInStackTrace()
fillInStackTrace
in class java.lang.Throwable
public int id()
Constant
Constant
.public java.lang.String name()
Constant
Constant
.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(Signal other)
compareTo
in interface java.lang.Comparable<Signal>
public java.lang.String toString()
toString
in class java.lang.Throwable