Class CompositeValue

java.lang.Object
com.northconcepts.datapipeline.core.CompositeValue

public class CompositeValue extends Object
A fixed-size list of values used as a composite key (for example in lookups, grouping and duplicate removal); a single-value instance hashes like, and equals, that value itself.
  • Constructor Details

    • CompositeValue

      public CompositeValue(int valueCount)
      Creates an instance with valueCount null values to fill in with set(int, Object).
    • CompositeValue

      public CompositeValue(List<?> values)
      Creates an instance holding a copy of the list's values.
    • CompositeValue

      public CompositeValue(Object... values)
      Creates an instance backed by the given array, which is not copied.
  • Method Details

    • set

      public CompositeValue set(int index, Object value)
    • get

      public Object get(int index)
    • getAll

      public Object[] getAll()
      Returns the backing array of values, not a copy; change values with set(int, Object) so the cached hash code is reset.
    • isNull

      public boolean isNull()
      Returns true if every value is null, including when there are no values.
    • size

      public int size()
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getValuesAsString

      public String getValuesAsString()
      Returns the values as a bracketed, comma-separated list, such as [a, 1, null].
    • toString

      public String toString()
      Overrides:
      toString in class Object