Class AttributeStateUtil

java.lang.Object
com.aquima.interactions.profile.model.AttributeStateUtil

public final class AttributeStateUtil extends Object
This class contains several utility methods that are used by the attribute state class.
Since:
7.0
Author:
A. Pragt
  • Method Details

    • isUnknown

      public static boolean isUnknown(IValue value, IAttributeDefinition attributeDefinition)
      This method checks if an IValue is unknown.
      Parameters:
      value - The value that should be checked.
      attributeDefinition - The attribute definition the value belongs to.
      Returns:
      Boolean indicating if the value is unknown.
    • hasSingleValue

      public static boolean hasSingleValue(IValue value)
      This method checks if a value contains exactly a single value.
      Parameters:
      value - The value that should be checked.
      Returns:
      Boolean indicating if the value contains a single value.
    • hasMultipleValues

      public static boolean hasMultipleValues(IValue value)
      This method checks if a value contains multiple values.
      Parameters:
      value - The value that should be checked.
      Returns:
      Boolean indicating if the value contains multiple values.
    • validateDomainValue

      public static IValue validateDomainValue(IValue attributeValue, IDomain domain, IAttributeDefinition attributeDefinition)
      This method validates the value against the current domain, and if valid, returns the internal domain value.
      Parameters:
      attributeValue - The value that should be validated.
      domain - The current domain the value should be validated with.
      attributeDefinition - The attribute definition the value belongs to.
      Returns:
      The value that should be used for the attribute.
      Throws:
      ConstraintViolationException - This exception is thrown when the value is not valid for the current domain.