Class DomainValues

All Implemented Interfaces:
IConvertable, IListValue, IValue, Serializable

public class DomainValues extends ListValue
This class represents the values of an external domain.

Instances start out empty. New values can be added by using the addDomainValue(IPrimitiveValue, IMultilingualText, String...) method.

Instances of this class may be returned from IDomainValuesFactory implementations. It may also be sub-classed. Please note that the addValue(IPrimitiveValue) and addAll(IPrimitiveValue[]) methods always throw an exception. The addDomainValue(IPrimitiveValue, IMultilingualText, String...) should be used instead.

Since:
11.0
Author:
Petru Galanton
See Also:
  • Constructor Details

    • DomainValues

      public DomainValues(DataType datatype, String domainName)
  • Method Details

    • addDomainValue

      public final void addDomainValue(IPrimitiveValue value, IMultilingualText text, String... presentationStyles)
      Adds a value to the set of values of the external domain. This method ensures that the type name of the value matches the domain name.
      Parameters:
      value - the value to be added
      text - the display value
      presentationStyles - the optional presentation styles of the value
    • addDomainValue

      public final void addDomainValue(String value, IMultilingualText text, String... presentationStyles)
      Convenience method for adding a StringValue.
      Parameters:
      value - the value
      text - the display value
      presentationStyles - the optional presentation styles
    • addDomainValue

      public final void addDomainValue(long value, IMultilingualText text, String... presentationStyles)
      Convenience method for adding an IntegerValue.
      Parameters:
      value - the value
      text - the display value
      presentationStyles - the optional presentation styles
    • addDomainValue

      public final void addDomainValue(double value, IMultilingualText text, String... presentationStyles)
      Convenience method for adding a NumberValue. For adding Currency or Percentage, use the generic variant of this method.
      Parameters:
      value - the value
      text - the display value
      presentationStyles - the optional presentation styles
    • addDomainValue

      public final void addDomainValue(boolean value, IMultilingualText text, String... presentationStyles)
      Convenience method for adding a BoleanValue.
      Parameters:
      value - the value
      text - the display value
      presentationStyles - the optional presentation styles
    • addValue

      public final boolean addValue(IPrimitiveValue primitiveValue)
      Always throws an exception. Use addDomainValue(IPrimitiveValue, IMultilingualText, String...) instead.
      Overrides:
      addValue in class ListValue
      Parameters:
      primitiveValue - The value that should be added.
      Returns:
      Boolean indicating if the value was actually added.
    • addAll

      public final void addAll(IPrimitiveValue[] values)
      Always throws an exception. Use addDomainValue(IPrimitiveValue, IMultilingualText, String...) instead.
      Overrides:
      addAll in class ListValue
      Parameters:
      values - Array containing all the values that need to be added.
    • getDomainValueAt

      public IDomainValueDefinition getDomainValueAt(int index)
      Returns the domain value definition at the specified zero-based index. The value of the returned domain value definition is the same as the value returned by ListValue.getValueAt(int) at the same index.

      This method should be used over ListValue.getValueAt(int) when additional information about the domain value is needed (such as presentation styles).

      The total number of domain values may be obtained using ListValue.getValueCount().

      Parameters:
      index - the index of the domain value definition
      Returns:
      the domain value definition
    • getDomainValues

      public IDomainValueDefinition[] getDomainValues()
      Returns all the domain value definitions. The values in each domain value definition at index n is the same as the value at index n in the array returned by ListValue.getValues().

      This method should be used over ListValue.getValues() when additional information about the domain values is needed (such as presentation styles).

      Returns:
      all domain values
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ListValue
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class ListValue