Class DataContractQualityRule

java.lang.Object
org.odpi.openmetadata.frameworks.integration.bitol.odcs.DataContractQualityRule

public class DataContractQualityRule extends Object
This class represents a data quality check defined in an Open Data Contract Standard (ODCS) data contract. Quality checks can be attached to a schema object or to a schema property. The "type" determines which of the other properties are relevant: text (description only), library (metric with a comparison operator), sql (query with a comparison operator) or custom (engine and implementation). Only one of the comparison operators (mustBe, mustNotBe, mustBeGreaterThan, ...) is expected.
  • Constructor Details

    • DataContractQualityRule

      public DataContractQualityRule()
      Default constructor
  • Method Details

    • getId

      public String getId()
      Return the stable identifier of this element (alphanumeric, hyphen and underscore characters only).
      Returns:
      string identifier
    • setId

      public void setId(String id)
      Set up the stable identifier of this element (alphanumeric, hyphen and underscore characters only).
      Parameters:
      id - string identifier
    • getName

      public String getName()
      Return the name of the quality check.
      Returns:
      string name
    • setName

      public void setName(String name)
      Set up the name of the quality check.
      Parameters:
      name - string name
    • getDescription

      public String getDescription()
      Return the description of the quality check.
      Returns:
      string description
    • setDescription

      public void setDescription(String description)
      Set up the description of the quality check.
      Parameters:
      description - string description
    • getType

      public String getType()
      Return the type of quality check: text, library, sql or custom. Standard values are defined in DataContractQualityType.
      Returns:
      string type name
    • setType

      public void setType(String type)
      Set up the type of quality check: text, library, sql or custom. Standard values are defined in DataContractQualityType.
      Parameters:
      type - string type name
    • getDimension

      public String getDimension()
      Return the data quality dimension being checked. Standard values are defined in DataContractQualityDimension.
      Returns:
      string dimension name
    • setDimension

      public void setDimension(String dimension)
      Set up the data quality dimension being checked. Standard values are defined in DataContractQualityDimension.
      Parameters:
      dimension - string dimension name
    • getMetric

      public String getMetric()
      Return the metric evaluated by a library check. Standard values are defined in DataContractQualityMetric.
      Returns:
      string metric name
    • setMetric

      public void setMetric(String metric)
      Set up the metric evaluated by a library check. Standard values are defined in DataContractQualityMetric.
      Parameters:
      metric - string metric name
    • getRule

      public String getRule()
      Return the name of the rule (deprecated in favour of metric).
      Returns:
      string rule name
    • setRule

      public void setRule(String rule)
      Set up the name of the rule (deprecated in favour of metric).
      Parameters:
      rule - string rule name
    • getSeverity

      public String getSeverity()
      Return the severity of a failure, for example info, warning or error.
      Returns:
      string severity
    • setSeverity

      public void setSeverity(String severity)
      Set up the severity of a failure, for example info, warning or error.
      Parameters:
      severity - string severity
    • getBusinessImpact

      public String getBusinessImpact()
      Return the business impact of a failure, for example operational or regulatory.
      Returns:
      string impact
    • setBusinessImpact

      public void setBusinessImpact(String businessImpact)
      Set up the business impact of a failure, for example operational or regulatory.
      Parameters:
      businessImpact - string impact
    • getMethod

      public String getMethod()
      Return the method used to perform the check, for example reconciliation.
      Returns:
      string method
    • setMethod

      public void setMethod(String method)
      Set up the method used to perform the check, for example reconciliation.
      Parameters:
      method - string method
    • getSchedule

      public String getSchedule()
      Return the schedule configuration for the scheduler, for example a cron expression.
      Returns:
      string schedule
    • setSchedule

      public void setSchedule(String schedule)
      Set up the schedule configuration for the scheduler, for example a cron expression.
      Parameters:
      schedule - string schedule
    • getScheduler

      public String getScheduler()
      Return the name of the scheduler that runs the check, for example cron.
      Returns:
      string scheduler name
    • setScheduler

      public void setScheduler(String scheduler)
      Set up the name of the scheduler that runs the check, for example cron.
      Parameters:
      scheduler - string scheduler name
    • getUnit

      public String getUnit()
      Return the unit of the values being compared, for example rows or percent.
      Returns:
      string unit
    • setUnit

      public void setUnit(String unit)
      Set up the unit of the values being compared, for example rows or percent.
      Parameters:
      unit - string unit
    • getQuery

      public String getQuery()
      Return the SQL query of a sql check. It may use the ${object} and ${property} placeholders.
      Returns:
      string SQL query
    • setQuery

      public void setQuery(String query)
      Set up the SQL query of a sql check. It may use the ${object} and ${property} placeholders.
      Parameters:
      query - string SQL query
    • getEngine

      public String getEngine()
      Return the name of the engine that runs a custom check, for example soda or great-expectations.
      Returns:
      string engine name
    • setEngine

      public void setEngine(String engine)
      Set up the name of the engine that runs a custom check, for example soda or great-expectations.
      Parameters:
      engine - string engine name
    • getImplementation

      public Object getImplementation()
      Return the engine specific implementation of a custom check (a string or a structure).
      Returns:
      implementation string or structure
    • setImplementation

      public void setImplementation(Object implementation)
      Set up the engine specific implementation of a custom check (a string or a structure).
      Parameters:
      implementation - implementation string or structure
    • getArguments

      public Map<String,Object> getArguments()
      Return the additional arguments for a library metric.
      Returns:
      map of argument names to values
    • setArguments

      public void setArguments(Map<String,Object> arguments)
      Set up the additional arguments for a library metric.
      Parameters:
      arguments - map of argument names to values
    • getMustBe

      public Object getMustBe()
      Return the value that the checked metric must be equal to.
      Returns:
      expected value
    • setMustBe

      public void setMustBe(Object mustBe)
      Set up the value that the checked metric must be equal to.
      Parameters:
      mustBe - expected value
    • getMustNotBe

      public Object getMustNotBe()
      Return the value that the checked metric must not be equal to.
      Returns:
      unexpected value
    • setMustNotBe

      public void setMustNotBe(Object mustNotBe)
      Set up the value that the checked metric must not be equal to.
      Parameters:
      mustNotBe - unexpected value
    • getMustBeGreaterThan

      public Number getMustBeGreaterThan()
      Return the value that the checked metric must be greater than.
      Returns:
      numeric threshold
    • setMustBeGreaterThan

      public void setMustBeGreaterThan(Number mustBeGreaterThan)
      Set up the value that the checked metric must be greater than.
      Parameters:
      mustBeGreaterThan - numeric threshold
    • getMustBeGreaterOrEqualTo

      public Number getMustBeGreaterOrEqualTo()
      Return the value that the checked metric must be greater than or equal to.
      Returns:
      numeric threshold
    • setMustBeGreaterOrEqualTo

      public void setMustBeGreaterOrEqualTo(Number mustBeGreaterOrEqualTo)
      Set up the value that the checked metric must be greater than or equal to.
      Parameters:
      mustBeGreaterOrEqualTo - numeric threshold
    • getMustBeLessThan

      public Number getMustBeLessThan()
      Return the value that the checked metric must be less than.
      Returns:
      numeric threshold
    • setMustBeLessThan

      public void setMustBeLessThan(Number mustBeLessThan)
      Set up the value that the checked metric must be less than.
      Parameters:
      mustBeLessThan - numeric threshold
    • getMustBeLessOrEqualTo

      public Number getMustBeLessOrEqualTo()
      Return the value that the checked metric must be less than or equal to.
      Returns:
      numeric threshold
    • setMustBeLessOrEqualTo

      public void setMustBeLessOrEqualTo(Number mustBeLessOrEqualTo)
      Set up the value that the checked metric must be less than or equal to.
      Parameters:
      mustBeLessOrEqualTo - numeric threshold
    • getMustBeBetween

      public List<Number> getMustBeBetween()
      Return the inclusive range (two values) that the checked metric must be within.
      Returns:
      list of two numbers
    • setMustBeBetween

      public void setMustBeBetween(List<Number> mustBeBetween)
      Set up the inclusive range (two values) that the checked metric must be within.
      Parameters:
      mustBeBetween - list of two numbers
    • getMustNotBeBetween

      public List<Number> getMustNotBeBetween()
      Return the range (two values) that the checked metric must be outside of.
      Returns:
      list of two numbers
    • setMustNotBeBetween

      public void setMustNotBeBetween(List<Number> mustNotBeBetween)
      Set up the range (two values) that the checked metric must be outside of.
      Parameters:
      mustNotBeBetween - list of two numbers
    • getTags

      public List<String> getTags()
      Return the list of tags attached to this element.
      Returns:
      list of tag strings
    • setTags

      public void setTags(List<String> tags)
      Set up the list of tags attached to this element.
      Parameters:
      tags - list of tag strings
    • getCustomProperties

      public List<BitolCustomProperty> getCustomProperties()
      Return the list of custom (key/value) properties attached to this element.
      Returns:
      list of custom properties
    • setCustomProperties

      public void setCustomProperties(List<BitolCustomProperty> customProperties)
      Set up the list of custom (key/value) properties attached to this element.
      Parameters:
      customProperties - list of custom properties
    • getAuthoritativeDefinitions

      public List<BitolAuthoritativeDefinition> getAuthoritativeDefinitions()
      Return the list of links to sources that provide more details about this element.
      Returns:
      list of authoritative definitions
    • setAuthoritativeDefinitions

      public void setAuthoritativeDefinitions(List<BitolAuthoritativeDefinition> authoritativeDefinitions)
      Set up the list of links to sources that provide more details about this element.
      Parameters:
      authoritativeDefinitions - list of authoritative definitions
    • toString

      public String toString()
      Standard toString method.
      Overrides:
      toString in class Object
      Returns:
      print out of variables in a JSON-style
    • equals

      public boolean equals(Object objectToCompare)
      Compare the values of the supplied object with those stored in the current object.
      Overrides:
      equals in class Object
      Parameters:
      objectToCompare - supplied object
      Returns:
      boolean result of comparison
    • hashCode

      public int hashCode()
      Return hash code based on properties.
      Overrides:
      hashCode in class Object
      Returns:
      int