public class PilarTrigger extends PilarParameter implements Trigger
KEY_TRUE property
to any other value than the default one, than true will reported
KEY_FALSE property is set, true will be reported
on KEY_FALSE takes precedence. If no parameter
name is set, the mother constructor throws an exception.
String values are not allowed, as the parameter is always parsed into a
double.
The properties of this trigger are also use as the properties to construct
the helper AnonymousTrigger, this means a default value of the
trigger, attainable a non-null value even if reading fails, is settable
via the AnonymousTrigger#KEY_INITBOOLEAN property.
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static double |
DEFTRUE
Default value class is Double.
|
static String |
KEY_FALSE
The value that defines false.
|
static String |
KEY_TRUE
The value that defines true.
|
private SimpleTrigger |
state
A helper to get further trigger functionality
|
KEY_DRIVERNAME, KEY_PILARGETKEY_CACHEKEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
PilarTrigger(Map<String,String> prop)
Constructs a new pilar value from the properties.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getElapsedToggleTime()
Returns the elapsed time from the last toggle event on the trigger
until now.
|
Date |
getLastToggleTime()
Returns the date of the last toggle event on this trigger.
|
Boolean |
getTrigger()
Returns the same value as
Parameter#get but already cast into a
boolean. |
protected Object |
getUncached()
Method called if cache is out of date.
|
boolean |
isTrue()
Returns the value of the trigger as a boolean primitive.
|
Boolean |
setTrigger(Boolean to)
Does the same thing as
Parameter#set but returns the old value
as a boolean. |
Boolean |
toggleTrigger()
Toggles the value of this trigger.
|
registerDriver, rescanned, updateget, getCache, getCacheFormatted, setcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, overrideDefaultName, register, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiesinitreloadpublic static final String KEY_TRUE
public static final String KEY_FALSE
private static final double DEFTRUE
private final SimpleTrigger state
public Boolean getTrigger()
Parameter#get but already cast into a
boolean.getTrigger in interface Triggeringpublic boolean isTrue()
isTrue in interface Triggeringpublic Boolean setTrigger(Boolean to) throws UnsupportedOperationException
Parameter#set but returns the old value
as a boolean.setTrigger in interface TriggeringUnsupportedOperationExceptionpublic Boolean toggleTrigger()
Parameter counterpart. The return value is the old value
of the trigger.toggleTrigger in interface Triggeringpublic Date getLastToggleTime()
getLastToggleTime in interface Triggeringpublic long getElapsedToggleTime()
getElapsedToggleTime in interface Triggeringprotected Object getUncached()
getUncached in class PilarParameter