Package com.postman.collection
Class PropertyList<T>
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Property>
,Collection<Property>
,List<Property>
,RandomAccess
Postman SDK analog: PropertyList
Extends ArrayList with Map like capabilities, including:
- Support for retrieving by variable key which is always
Property.getKey()
- Support for retrieving by index
- Support for adding by index
- Duplicate keys are not allowed
- Null keys are allowed.
- Contains returns results based on
Property.equals(Object)
- Set will set the value of the variable in this ListMap if it exists, otherwise it will set the value of the specified
index
- the
add
method returns false if the specified key already exists in the collection and does not change the collection
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionReturns an emptyPropertyList
PropertyList
(ArrayList<Property> vars) Returns a PropertyList populated with the contents ofvars
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(int index, PropertyList<Property> vars) boolean
addAll
(PropertyList<Property> vars) boolean
boolean
containsKey
(String key) get
(int index) Get a variable whose key matcheskey
, or null if it is not presentint
void
Methods inherited from class java.util.ArrayList
add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, 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
-
PropertyList
Returns a PropertyList populated with the contents ofvars
- Parameters:
vars
- ArrayList<Property> of variables
-
PropertyList
public PropertyList()Returns an emptyPropertyList
-
-
Method Details
-
get
Get a variable whose key matcheskey
, or null if it is not present- Parameters:
key
-- Returns:
- Property
-
containsKey
- Parameters:
key
-- Returns:
- boolean
-
get
-
contains
- Parameters:
compare
-- Returns:
- boolean
-
indexOf
- Parameters:
pvVar
-- Returns:
- int
-
add
-
addAll
- Parameters:
vars
-- Returns:
- boolean
-
addAll
- Parameters:
index
-vars
-- Returns:
- boolean
-
remove
- Parameters:
key
-
-
set
-
set
-