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.Throwablepublic java.lang.Throwable fillInStackTrace()
fillInStackTrace in class java.lang.Throwablepublic int id()
ConstantConstant.public java.lang.String name()
ConstantConstant.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(Signal other)
compareTo in interface java.lang.Comparable<Signal>public java.lang.String toString()
toString in class java.lang.Throwable