Class MetadataContainer
java.lang.Object
hudson.model.InvisibleAction
com.google.jenkins.plugins.metadata.MetadataContainer
- All Implemented Interfaces:
Action
,ModelObject
A build's
InvisibleAction
containing metadata.
This is intended as append-only store for metadata information. Metadata
providing code simply call add(MetadataValue)
to contribute
metadata, and getMetadata()
to consume metadata.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(MetadataValue mv) Add aMetadataValue
to this container.<T extends MetadataValue>
MetadataContaineradd
a list of elements<T extends MetadataValue>
Tdeserialize
(Class<T> clazz, String serialized) com.google.common.collect.Multimap<String,
MetadataValue> static com.google.common.collect.Multimap<String,
MetadataValue> getMetadata
(Run<?, ?> build) <T extends MetadataValue>
Iterable<T>listDeserialize
(Class<T> clazz, String serialized) <T extends MetadataValue>
StringlistSerialize
(Iterable<T> values) static MetadataContainer
void
remove
a list of elementsserialize
(MetadataValue metadataValue) Methods inherited from class hudson.model.InvisibleAction
getDisplayName, getIconFileName, getUrlName
-
Constructor Details
-
MetadataContainer
public MetadataContainer()
-
-
Method Details
-
getMetadata
- Returns:
- the metadata contained.
-
add
Add aMetadataValue
to this container.- Parameters:
mv
- the givenMetadataValue
to add.- Returns:
- this
MetadataContainer
.
-
addAll
add
a list of elements -
removeAll
remove
a list of elements -
getSerializedMetadata
- Returns:
- the serialized form of the metadata;
-
of
- Parameters:
build
- a given build.- Returns:
- the
MetadataContainer
for the given build.
-
serialize
- Parameters:
metadataValue
- the metadata value to be serialized.- Returns:
- serialized form of the given
MetadataValue
. - Throws:
MetadataSerializationException
- when serialization runs into problem.
-
listSerialize
- Parameters:
values
- the metadata values to be serialized.- Returns:
- serialized form of the given
MetadataValue
. - Throws:
MetadataSerializationException
- when serialization runs into problem.
-
deserialize
- Parameters:
clazz
- class of theMetadataValue
object to be deserialized.serialized
- the string to deserialize.- Returns:
- the deserialized
MetadataValue
object.
-
listDeserialize
- Parameters:
clazz
- the class of theMetadataValue
to be deserialize.serialized
- the serialized form to be deserialized.- Returns:
- a list of deserialized objects.
-
getMetadata
- Parameters:
build
- a givenRun
.- Returns:
- the metadata contained in the
MetadataContainer
of the givenRun
.
-