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
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
<E,
I extends Iterable<E>>
IConvenience method to return the property value as an instance ofIterable
with element typeE
.<T> T
int
hashCode()
boolean
isEmpty()
keySet()
void
int
size()
toString()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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 ofIterable
with 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:
containsKey
in interfaceMap<String,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
Object>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
toString
-