org.erights.e.meta.java.lang
Class ThrowableGuardSugar
java.lang.Object
|
+--org.erights.e.elib.slot.BaseGuard
|
+--org.erights.e.elib.slot.BaseAuditor
|
+--org.erights.e.elib.base.TypeDesc
|
+--org.erights.e.elib.base.ClassDesc
|
+--org.erights.e.meta.java.lang.ThrowableGuardSugar
- All Implemented Interfaces:
- Auditor, Guard, Marker, Persistent, Serializable, SlotGuard, ValueGuard
- public class ThrowableGuardSugar
- extends ClassDesc
Untamed: Coerces Strings, Twine, and Throwables to kinds of Throwbles.
Strings and Twine coerce to RuntimeException or Twine, and thereby also to
Exception and Throwable. Throwables coerce to RuntimeException.
- Author:
- Mark S. Miller
- See Also:
- Serialized Form
Fields inherited from class org.erights.e.elib.base.ClassDesc |
|
Fields inherited from class org.erights.e.elib.base.TypeDesc |
|
Method Summary |
Object |
subCoerce(Object specimen,
OneArgFunc optEjector)
Enabled: This method can (and typically will) return a RuntimeException,
independent of myClass, so, if myClass isn't RuntimeException,
Exception, or Throwable, the result will often not represent a
successful coercion. |
Methods inherited from class org.erights.e.elib.base.ClassDesc |
asClass, byJavaRules, coerce, flatName, flatSig, get, get, isFloating, isIntegral, make, sig, sig, simpleName, simpleSig |
serialVersionUID
static final long serialVersionUID
ThrowableGuardSugar
public ThrowableGuardSugar(Class clazz)
- Enabled: @param clazz must be a type of Throwable
subCoerce
public Object subCoerce(Object specimen,
OneArgFunc optEjector)
- Enabled: This method can (and typically will) return a RuntimeException,
independent of myClass, so, if myClass isn't RuntimeException,
Exception, or Throwable, the result will often not represent a
successful coercion. We let 'coerce' sort this out.
- Overrides:
subCoerce
in class ClassDesc
comments?