Package com.helger.commons.url
Class URLParameterList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<ELEMENTTYPE>
-
- com.helger.commons.collection.impl.CommonsArrayList<URLParameter>
-
- com.helger.commons.url.URLParameterList
-
- All Implemented Interfaces:
ICommonsCollection<URLParameter>,ICommonsIterable<URLParameter>,ICommonsList<URLParameter>,ICloneable<ICommonsList<URLParameter>>,IHasSize,IGenericImplTrait<URLParameterList>,IURLParameterList<URLParameterList>,Serializable,Cloneable,Iterable<URLParameter>,Collection<URLParameter>,List<URLParameter>,RandomAccess
@NotThreadSafe public class URLParameterList extends CommonsArrayList<URLParameter> implements IURLParameterList<URLParameterList>
A list of URL parameters with a sanity API. It allows for multiple URL parameters with the same name and thereby maintaining the order of the URL parameters.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description URLParameterList()URLParameterList(List<? extends URLParameter> aOther)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(String sName)booleancontains(String sName, String sValue)ICommonsOrderedSet<String>getAllParamNames()ICommonsList<String>getAllParamValues(String sName)ICommonsOrderedMap<String,ICommonsList<String>>getAsMultiMap()URLParameterListgetClone()StringgetFirstParamValue(String sName)Get the value of the first parameter with the provided nameURLParameterListremove(String sName)Remove all parameter with the given name.URLParameterListremove(String sName, String sValue)Remove all parameter with the given name and value.-
Methods inherited from class com.helger.commons.collection.impl.CommonsArrayList
createFiltered, createFiltered, createFiltered, createFiltered, createFiltered, createFiltered, createInstance
-
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, removeIf, stream, toArray
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsCollection
addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addIf, addIfNotNull, addObject, getAtIndex, getAtIndex, getAtIndex, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getCopyAsList, getCount, getSorted, iterator2, removeAll, removeObject, set, setAll, setAll, setAllMapped, setAllMapped
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsIterable
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEachBreakable, forEachByIndex, forEachThrowing, getCount
-
Methods inherited from interface com.helger.commons.collection.impl.ICommonsList
getAll, getAllInstanceOf, getAllMapped, getAllMapped, getAsUnmodifiable, getAtIndex, getFirst, getFirst, getLast, getLast, getSortedInline, removeAndReturnElementAtIndex, removeAtIndex, removeFirst, removeLast, reverse, setFirst, setLast, swapItems
-
Methods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsT
-
Methods inherited from interface com.helger.commons.lang.IHasSize
isEmpty, isNotEmpty, size
-
Methods inherited from interface com.helger.commons.url.IURLParameterList
add, add, add, add, add, add, add, add, addAll, addAll, addAll, addIf, addIfNotNull, addRandom
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Constructor Detail
-
URLParameterList
public URLParameterList()
-
URLParameterList
public URLParameterList(@Nullable List<? extends URLParameter> aOther)
-
-
Method Detail
-
remove
@Nonnull public URLParameterList remove(@Nullable String sName)
Remove all parameter with the given name.- Parameters:
sName- The key to remove- Returns:
- this
-
remove
@Nonnull public URLParameterList remove(@Nullable String sName, @Nullable String sValue)
Remove all parameter with the given name and value.- Parameters:
sName- The key to remove. May benull.sValue- The value to be removed. May benull.- Returns:
- this
-
getAllParamNames
@Nonnull @ReturnsMutableCopy public ICommonsOrderedSet<String> getAllParamNames()
-
getAllParamValues
@Nonnull @ReturnsMutableCopy public ICommonsList<String> getAllParamValues(@Nullable String sName)
-
getFirstParamValue
@Nullable public String getFirstParamValue(@Nullable String sName)
Get the value of the first parameter with the provided name- Parameters:
sName- The parameter name to search- Returns:
nullif no such parameter is present.
-
getAsMultiMap
@Nonnull @ReturnsMutableCopy public ICommonsOrderedMap<String,ICommonsList<String>> getAsMultiMap()
- Returns:
- A new multi map (map from String to List of String) with all
values. Order may be lost. Never
null.
-
getClone
@Nonnull @ReturnsMutableCopy public URLParameterList getClone()
- Specified by:
getClonein interfaceICloneable<ICommonsList<URLParameter>>- Overrides:
getClonein classCommonsArrayList<URLParameter>- Returns:
- A 100% deep-copy of the implementing class.
-
-