java.lang.Object
org.odpi.openmetadata.adapters.connectors.integration.bitol.contractevaluator.ContractMeasurements

public class ContractMeasurements extends Object
ContractMeasurements turns the properties recorded by the surveys into measurements that a contract can be checked against.

In the resource properties of a measurement annotation, a property called value.NAME is the value of NAME and unit.NAME is its unit. Any other property is a measurement in its own right, with no unit. The JSON properties of a declared schema annotation list the fields that a file declares, which shows that a field is present, and its type, without giving a value.

  • Field Details

    • VALUE_PREFIX

      public static final String VALUE_PREFIX
      Prefix of a resource property that holds the value of a named measurement.
      See Also:
    • UNIT_PREFIX

      public static final String UNIT_PREFIX
      Prefix of a resource property that holds the unit of a named measurement.
      See Also:
  • Method Details

    • fromResourceProperties

      public static List<ContractMeasurement> fromResourceProperties(Map<String,String> resourceProperties, String source)
      Return the measurements held in the resource properties of an annotation.
      Parameters:
      resourceProperties - resource properties (may be null)
      source - description of the annotation
      Returns:
      measurements, in name order
    • fromDeclaredSchema

      public static List<ContractMeasurement> fromDeclaredSchema(String jsonProperties, String source)
      Return the fields listed in the JSON properties of a declared schema annotation. They have a type but no value.
      Parameters:
      jsonProperties - JSON properties (may be null)
      source - description of the annotation
      Returns:
      measurements - empty if the JSON does not list any fields