Class Checks.Check
java.lang.Object
org.scictrl.csshell.epics.server.processor.Checks.Check
Simple configurable check, that test value against some criteria.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Checks.CheckStatic check based on ALWAYS.static final Checks.CheckStatic check based on NEVER. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.Check(Checks.Condition operation, double testValue, double precision) Constructor.Check(Checks.Condition operation, double testValue, double precision, String link) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheck(double value) Returnstrueif tested value is meeting the configured criteria.static Checks.CheckfromConfiguration(org.apache.commons.configuration.HierarchicalConfiguration c) Extracts check parameters from XML based Configuration.static Checks.CheckfromConfiguration(org.apache.commons.configuration.HierarchicalConfiguration c, Double value, Double precision) Extracts check parameters from XML based Configuration.Returns test condition.getLink()Remote link, if available.doubleReturns value precision.doubleReturns test value.booleanisAlways()Returnstrueif condition ALWAYS.booleanisNever()Returnstrueif condition NEVERtoString()
-
Field Details
-
ALWAYS
Static check based on ALWAYS. -
NEVER
Static check based on NEVER.
-
-
Constructor Details
-
Check
Constructor.- Parameters:
operation- conditiontestValue- test valueprecision- value precision
-
Check
Constructor.- Parameters:
operation- conditiontestValue- test valueprecision- value precisionlink- remote link that provides value
-
Check
Constructor.- Parameters:
operation- conditiontestValue- test valueprecision- value precision
-
Check
Constructor.- Parameters:
operation- conditiontestValue- test valueprecision- value precisionlink- remote link that provides value
-
-
Method Details
-
fromConfiguration
public static Checks.Check fromConfiguration(org.apache.commons.configuration.HierarchicalConfiguration c) Extracts check parameters from XML based Configuration. TheChecks.Conditionkeywords must be defined as attributes to a tag. Tag must be provided as Configuration, attributes must have a defined value.
Example:<check equal=1.0 precision=0.0001 />, element name can be arbitrary- Parameters:
c- configuration- Returns:
- new Check
-
fromConfiguration
public static Checks.Check fromConfiguration(org.apache.commons.configuration.HierarchicalConfiguration c, Double value, Double precision) Extracts check parameters from XML based Configuration. TheChecks.Conditionkeywords must be defined as attributes to a tag. Tag must be provided as Configuration, attributes must have a defined value.
Example:<check equal=1.0 precision=0.0001 />, element name can be arbitrary- Parameters:
c- configurationvalue- test valueprecision- value precision- Returns:
- new Check object
-
check
public boolean check(double value) Returnstrueif tested value is meeting the configured criteria.- Parameters:
value- value to be tested- Returns:
trueif tested value is meeting the configured criteria.
-
getCondition
Returns test condition.- Returns:
- test condition
-
getTestValue
public double getTestValue()Returns test value.- Returns:
- test value
-
getPrecision
public double getPrecision()Returns value precision.- Returns:
- value precision
-
getLink
Remote link, if available.- Returns:
- remote link, if available
-
isAlways
public boolean isAlways()Returnstrueif condition ALWAYS.- Returns:
trueif condition ALWAYS
-
isNever
public boolean isNever()Returnstrueif condition NEVER- Returns:
trueif condition NEVER
-
toString
-