com.univocity.parsers.common.fields
Class FieldSet<T>

java.lang.Object
  extended by com.univocity.parsers.common.fields.FieldSet<T>
Type Parameters:
T - the type of the reference information used to uniquely identify a field (e.g. references to field indexes would use Integer, while references to field names would use String).
Direct Known Subclasses:
ExcludeFieldIndexSelector, ExcludeFieldNameSelector, FieldIndexSelector, FieldNameSelector

public class FieldSet<T>
extends Object

A set of selected fields.

Used by CommonSettings to select fields for reading/writing

Also used by com.univocity.parsers.common.processor.ConversionProcessor to select fields that have to be converted.

Author:
uniVocity Software Pty Ltd - [email protected]
See Also:
FieldNameSelector, FieldIndexSelector, CommonSettings

Constructor Summary
FieldSet()
           
 
Method Summary
 FieldSet<T> add(Collection<T> fields)
          Validates and adds multiple field references
 FieldSet<T> add(T... fields)
          Validates and adds multiple field references
 String describe()
          Returns a string that represents the current field selection
 FieldSet<T> remove(Collection<T> fields)
          Removes multiple field references in the selection
 FieldSet<T> remove(T... fields)
          Removes multiple field references in the selection
 FieldSet<T> set(Collection<T> fields)
          Validates and sets multiple field references.
 FieldSet<T> set(T... fields)
          Validates and sets multiple field references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldSet

public FieldSet()
Method Detail

add

public FieldSet<T> add(T... fields)
Validates and adds multiple field references

Parameters:
fields - information that uniquely identifies each field
Returns:
the set of currently selected fields

set

public FieldSet<T> set(T... fields)
Validates and sets multiple field references. Any existing reference will be discarded.

Parameters:
fields - information that uniquely identifies each field
Returns:
the set of currently selected fields

add

public FieldSet<T> add(Collection<T> fields)
Validates and adds multiple field references

Parameters:
fields - information that uniquely identifies each field
Returns:
the set of currently selected fields

set

public FieldSet<T> set(Collection<T> fields)
Validates and sets multiple field references. Any existing reference will be discarded.

Parameters:
fields - information that uniquely identifies each field
Returns:
the set of currently selected fields

remove

public FieldSet<T> remove(T... fields)
Removes multiple field references in the selection

Parameters:
fields - information that uniquely identifies each field
Returns:
the set of currently selected fields

remove

public FieldSet<T> remove(Collection<T> fields)
Removes multiple field references in the selection

Parameters:
fields - information that uniquely identifies each field
Returns:
the set of currently selected fields

describe

public String describe()
Returns a string that represents the current field selection

Returns:
a string that represents the current field selection


Copyright © 2015 uniVocity Software Pty Ltd. All rights reserved.