Class FieldList

java.lang.Object
com.northconcepts.datapipeline.core.FieldList
All Implemented Interfaces:
Cloneable, Iterable<String>

public class FieldList extends Object implements Cloneable, Iterable<String>
See FieldPath for supported field name expressions.
  • Constructor Details

    • FieldList

      public FieldList(String... fieldNames)
  • Method Details

    • iterator

      public Iterator<String> iterator()
      Returns an iterator over the fields in this list.
      Specified by:
      iterator in interface Iterable<String>
    • clone

      public FieldList clone()
      Returns a new FieldList that is a copy of this FieldList.
      Overrides:
      clone in class Object
    • add

      public FieldList add(String... fieldNames)
      Appends all the specified fields to the end of this list.
    • add

      public FieldList add(Collection<String> fieldNames)
      Appends all the fields in the specified collection to the end of this list.
    • remove

      public FieldList remove(String... fieldNames)
      Removes all the specified fields from this list.
    • remove

      public FieldList remove(FieldList fieldList)
      Removes all the fields in the specified fieldList from this list.
    • clear

      public FieldList clear()
      Removes all the fields from this list.
    • contains

      public boolean contains(String... fieldNames)
      Returns true if the supplied fieldNames all are existing in this list.
    • contains

      public boolean contains(List<String> fieldNames)
      Returns true if the supplied fieldNames all are existing in this list.
    • containedWithin

      public boolean containedWithin(String... fieldNames)
      Returns true if the supplied fieldNames contains all the fields names in this list.
    • containedWithin

      public boolean containedWithin(List<String> fieldNames)
      Returns true if the supplied fieldNames contains all the fields names in this list.
    • isEmpty

      public boolean isEmpty()
    • isNotEmpty

      public boolean isNotEmpty()
    • size

      public int size()
    • get

      public String get(int index)
    • getFieldPath

      public FieldPath getFieldPath(int index)
      Returns the entry at the given index parsed as a FieldPath; parsing also replaces quoted entries in this list with their unquoted form.
    • getList

      public List<String> getList()
      Returns the backing list of field names, not a copy.
    • toArray

      public String[] toArray()
    • forEach

      public void forEach(Consumer<? super String> consumer)
      Performs the given action for each field in this record.
      Specified by:
      forEach in interface Iterable<String>
    • stream

      public Stream<String> stream()
      Returns a sequential Stream of the fields in this list.
    • parallelStream

      public Stream<String> parallelStream()
      Returns a parallel Stream of the fields in this list.
    • equals

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

      public boolean isTabular()
      Indicates if all the fields match against a flat record (i.e. no nested records or array fields).
    • hashCode

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

      public String toString(String elementFormat, String fieldSeparator)
      Returns the field names joined by fieldSeparator, each formatted with String.format(elementFormat, name).
    • toString

      public String toString(String fieldSeparator)
    • toString

      public String toString()
      Overrides:
      toString in class Object