Class AttributeMap
java.lang.Object
com.atlassian.bitbucket.attribute.AttributeMap
Mutable collection of attributes mapped by string keys. Allows for storing any object as a property value.
- Since:
- 5.13
- See Also:
-
Nested Class Summary
-
Constructor 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()
values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
AttributeMap
public AttributeMap()
-
-
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
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap<String,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<String,
Object>
-
entrySet
-
equals
-
get
-
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-