Class Checks.Check

java.lang.Object
org.scictrl.csshell.epics.server.processor.Checks.Check
Enclosing class:
Checks<A>

public static final class Checks.Check extends Object
Simple configurable check, that test value against some criteria.
  • Field Details

    • ALWAYS

      public static final Checks.Check ALWAYS
      Static check based on ALWAYS.
    • NEVER

      public static final Checks.Check NEVER
      Static check based on NEVER.
  • Constructor Details

    • Check

      public Check(Checks.Condition operation, double testValue, double precision)
      Constructor.
      Parameters:
      operation - condition
      testValue - test value
      precision - value precision
    • Check

      public Check(Checks.Condition operation, double testValue, double precision, String link)
      Constructor.
      Parameters:
      operation - condition
      testValue - test value
      precision - value precision
      link - remote link that provides value
    • Check

      public Check(String operation, String testValue, String precision)
      Constructor.
      Parameters:
      operation - condition
      testValue - test value
      precision - value precision
    • Check

      public Check(String operation, String testValue, String precision, String link)
      Constructor.
      Parameters:
      operation - condition
      testValue - test value
      precision - value precision
      link - 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. The Checks.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. The Checks.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
      value - test value
      precision - value precision
      Returns:
      new Check object
    • check

      public boolean check(double value)
      Returns true 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

      public Checks.Condition 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

      public String getLink()
      Remote link, if available.
      Returns:
      remote link, if available
    • isAlways

      public boolean isAlways()
      Returns true if condition ALWAYS.
      Returns:
      true if condition ALWAYS
    • isNever

      public boolean isNever()
      Returns true if condition NEVER
      Returns:
      true if condition NEVER
    • toString

      public String toString()
      Overrides:
      toString in class Object