Class FieldSet<T>
java.lang.Object
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).
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ExcludeFieldEnumSelector
,ExcludeFieldIndexSelector
,ExcludeFieldNameSelector
,FieldEnumSelector
,FieldIndexSelector
,FieldNameSelector
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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(Collection<T> fields) Validates and adds multiple field referencesValidates and adds multiple field referencesprivate void
addElement
(T field) Validates and adds a reference to a field.clone()
describe()
Returns a string that represents the current field selectionget()
Returns a copy of the fields in this setremove
(Collection<T> fields) Removes multiple field references in the selectionRemoves multiple field references in the selectionset
(Collection<T> fields) Validates and sets multiple field references.Validates and sets multiple field references.toString()
-
Field Details
-
fields
-
wrappedFieldSets
-
-
Constructor Details
-
FieldSet
public FieldSet()Creates am empty field set. For internal use only. -
FieldSet
Creates a field set that wraps a collection of other field sets. For internal use only.- Parameters:
wrappedFieldSets
- the field sets to be wrapped.
-
-
Method Details
-
get
Returns a copy of the fields in this set- Returns:
- a copy of the fields in this set
-
set
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
Validates and adds multiple field references- Parameters:
fields
- information that uniquely identifies each field- Returns:
- the set of currently selected fields
-
addElement
Validates and adds a reference to a field.- Parameters:
field
- information that uniquely identifies a field
-
set
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
Validates and adds multiple field references- Parameters:
fields
- information that uniquely identifies each field- Returns:
- the set of currently selected fields
-
remove
Removes multiple field references in the selection- Parameters:
fields
- information that uniquely identifies each field- Returns:
- the set of currently selected fields
-
remove
Removes multiple field references in the selection- Parameters:
fields
- information that uniquely identifies each field- Returns:
- the set of currently selected fields
-
describe
Returns a string that represents the current field selection- Returns:
- a string that represents the current field selection
-
toString
-
clone
-