Package org.jdrupes.httpcodec.types
Class StringList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,List<String>
,RandomAccess
Represents a list of strings with some additional methods.
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionCreates a new empty list of strings.StringList
(int initialCapacity) Creates a new empty list of strings with an initial capacity.StringList
(String item, String... items) Creates a new list with given items.StringList
(Collection<String> existing) Creates a new list with items copied from the existing collection. -
Method Summary
Modifier and TypeMethodDescriptionappendIfNotContained
(String value) Appends the value to the list of values if it is not already in the list.boolean
containsIgnoreCase
(String value) Returns whether the list contains the given value, ignoring differences in the cases of the letters.void
removeIgnoreCase
(String value) Removes all strings equal to the given value, ignoring differences in the cases of the letters.Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
StringList
public StringList()Creates a new empty list of strings. -
StringList
Creates a new empty list of strings with an initial capacity.- Parameters:
initialCapacity
- the capacity
-
StringList
Creates a new list with items copied from the existing collection.- Parameters:
existing
- the existing collection
-
StringList
Creates a new list with given items.- Parameters:
item
- first itemitems
- more items
-
-
Method Details
-
containsIgnoreCase
Returns whether the list contains the given value, ignoring differences in the cases of the letters.- Parameters:
value
- the value to compare with- Returns:
- the result
-
removeIgnoreCase
Removes all strings equal to the given value, ignoring differences in the cases of the letters.- Parameters:
value
- the value to compare with
-
appendIfNotContained
Appends the value to the list of values if it is not already in the list.- Parameters:
value
- the value- Returns:
- the field
-