org.erights.e.elib.slot
Class AnyGuard
java.lang.Object
|
+--org.erights.e.elib.slot.BaseGuard
|
+--org.erights.e.elib.slot.AnyGuard
- All Implemented Interfaces:
- Guard, SlotGuard, ValueGuard
- public final class AnyGuard
- extends BaseGuard
Safe: The "any" guard behavior -- don't worry, be happy.
As a ValueGuard, accepts everything without any coercion (the identity
coercion). As a SlotGuard, makes a coercion-free settable slot. The
object named "any" delegates to the one AnyGuard.
- Author:
- Mark S. Miller
Methods inherited from class org.erights.e.elib.slot.BaseGuard |
__printOn, accepts, and, butNot, coerce, get, makeSlot, not, or, toString, xor |
THE_ONE
public static final AnyGuard THE_ONE
- Enabled: The one instance
AnyGuard
private AnyGuard()
getName
public String getName()
- Enabled:
- Specified by:
getName
in interface SlotGuard
- Overrides:
getName
in class BaseGuard
coerce
public Object coerce(Object specimen,
OneArgFunc optEjector)
- Enabled: Any specimen is acceptable as is, so return the specimen unchanged.
- Specified by:
coerce
in interface ValueGuard
- Overrides:
coerce
in class BaseGuard
makeSlot
public Slot makeSlot(Object specimen,
OneArgFunc optEjector)
- Enabled: Returns a settable slot that does no coercion, ie, a SimpleSlot.
- Specified by:
makeSlot
in interface SlotGuard
- Overrides:
makeSlot
in class BaseGuard
comments?