A container for name/value pairs, known as fields.
A Field is composed of a name string that can be case-sensitive
or case-insensitive (by specifying the option at the constructor) and
of a case-sensitive set of value strings.
The implementation of this class is not thread safe.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Fields.
A named list of string values. |
| Modifier and Type | Field and Description |
|---|---|
| public static final Fields | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Fields(boolean
whether this caseSensitive)Fields instance must be case sensitiveCreates an empty, modifiable, case insensitive |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public Fields | |
| public void | |
| public static Fields | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public Fields. | |
| public Set | |
| public int | |
| public String | |
| public List | |
| public List | getValuesOrEmpty(String
the field name name)Returns: the values of the field with the given name, or empty list if no such field exists |
| public int | |
| public boolean | |
| public Iterator | Returns: an iterator over theFields present in this instanceImplements java. Returns an iterator over elements of type |
| public void | |
| public void | put(Fields.
the field to put fieldInserts or replaces the given |
| public Fields. | |
| public Stream | |
| public String | |
| public Map |
| EMPTY | back to summary |
|---|---|
| public static final Fields EMPTY | |
| fields | back to summary |
|---|---|
| private final Map<String, Fields. | |
| Fields | back to summary |
|---|---|
| public Fields() Creates an empty, modifiable, case insensitive | |
| Fields | back to summary |
|---|---|
| public Fields(boolean caseSensitive) Creates an empty, modifiable, case insensitive
| |
| Fields | back to summary |
|---|---|
| public Fields(Map<String, Fields. | |
| add | back to summary |
|---|---|
| public void add(String name, String value) Adds the given value to a field with the given name,
creating a | |
| add | back to summary |
|---|---|
| public void add(Fields. Adds the given field, storing it if none exists for the given name, or adding all the values to the existing field with the given name. | |
| addAll | back to summary |
|---|---|
| public void addAll(Fields fields) | |
| asImmutable | back to summary |
|---|---|
| public Fields asImmutable() | |
| clear | back to summary |
|---|---|
| public void clear() Empties this
| |
| combine | back to summary |
|---|---|
| public static Fields combine(Fields a, Fields b) Combine two Fields | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| get | back to summary |
|---|---|
| public Fields. | |
| getNames | back to summary |
|---|---|
| public Set | |
| getSize | back to summary |
|---|---|
| public int getSize() Get the number of fields.
| |
| getValue | back to summary |
|---|---|
| public String getValue(String name) | |
| getValues | back to summary |
|---|---|
| public List | |
| getValuesOrEmpty | back to summary |
|---|---|
| public List | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEmpty | back to summary |
|---|---|
public boolean isEmpty()
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type | |
| put | back to summary |
|---|---|
| public void put(String name, String value) Inserts or replaces the given name/value pair as a single-valued | |
| put | back to summary |
|---|---|
| public void put(Fields. Inserts or replaces the given | |
| remove | back to summary |
|---|---|
| public Fields. Removes the | |
| stream | back to summary |
|---|---|
| public Stream | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| toStringArrayMap | back to summary |
|---|---|
| public Map | |
A named list of string values.
The name is case-sensitive and there must be at least one value.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | |
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | |
| public String | |
| public Integer | Returns: the result ofgetValue() converted to an integer, or nullAttempts to convert the result of |
| public List | |
| public int | |
| public boolean | |
| public String |
| name | back to summary |
|---|---|
| private final String name | |
| values | back to summary |
|---|---|
| private final List<String> values | |
| Field | back to summary |
|---|---|
| public Field(String name, String value) | |
| Field | back to summary |
|---|---|
| private Field(String name, List<String> values, String... moreValues) | |
| Field | back to summary |
|---|---|
| private Field(String name, List<String> values, List<String> moreValues) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getName | back to summary |
|---|---|
public String getName()
| |
| getValue | back to summary |
|---|---|
public String getValue()
| |
| getValueAsInt | back to summary |
|---|---|
| public Integer getValueAsInt() Attempts to convert the result of
| |
| getValues | back to summary |
|---|---|
| public List | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasMultipleValues | back to summary |
|---|---|
public boolean hasMultipleValues()
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |