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
Modifier and TypeFieldDescriptionstatic final Checks.Check
Static check based on ALWAYS.static final Checks.Check
Static check based on NEVER. -
Constructor Summary
ConstructorDescriptionConstructor.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 TypeMethodDescriptionboolean
check
(double value) Returnstrue
if tested value is meeting the configured criteria.static Checks.Check
fromConfiguration
(org.apache.commons.configuration.HierarchicalConfiguration c) Extracts check parameters from XML based Configuration.static Checks.Check
fromConfiguration
(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.double
Returns value precision.double
Returns test value.boolean
isAlways()
Returnstrue
if condition ALWAYS.boolean
isNever()
Returnstrue
if 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.Condition
keywords 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.Condition
keywords 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) Returnstrue
if tested value is meeting the configured criteria.- Parameters:
value
- value to be tested- Returns:
true
if 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()Returnstrue
if condition ALWAYS.- Returns:
true
if condition ALWAYS
-
isNever
public boolean isNever()Returnstrue
if condition NEVER- Returns:
true
if condition NEVER
-
toString
-