Package com.atlassian.bitbucket.property
Class PropertyMap
java.lang.Object
com.atlassian.bitbucket.property.PropertyMap
Immutable collection of properties mapped by string keys. Allows for storing any object as a property value.
It is strongly encouraged that the property values can be marshalled to/from JSON, or they will not be included in REST responses.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()boolean<E,I extends Iterable<E>>
IConvenience method to return the property value as an instance ofIterablewith element typeE.<T> TinthashCode()booleanisEmpty()keySet()voidintsize()toString()values()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
EMPTY
-
-
Method Details
-
getAs
-
getAs
@Nullable public <E,I extends Iterable<E>> I getAs(@Nonnull String key, @Nonnull Class<I> iterableType, @Nonnull Class<E> elementType) Convenience method to return the property value as an instance ofIterablewith element typeE.- Type Parameters:
E- type of the elementI- type of the iterable- Parameters:
key- property keyiterableType- class representing the expected type of the iterableelementType- class representing the expected type of the elements- Returns:
- property value, as an instance of
I, ornull, if this property map does not contain a property with keykey - Throws:
ClassCastException- if the property exists, but is not of expected typeiterableType
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
toString
-