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 aMetadataValueto this container.<T extends MetadataValue>
MetadataContaineradda 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 MetadataContainervoidremovea 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 aMetadataValueto this container.- Parameters:
mv- the givenMetadataValueto add.- Returns:
- this
MetadataContainer.
-
addAll
adda list of elements -
removeAll
removea list of elements -
getSerializedMetadata
- Returns:
- the serialized form of the metadata;
-
of
- Parameters:
build- a given build.- Returns:
- the
MetadataContainerfor 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 theMetadataValueobject to be deserialized.serialized- the string to deserialize.- Returns:
- the deserialized
MetadataValueobject.
-
listDeserialize
- Parameters:
clazz- the class of theMetadataValueto 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
MetadataContainerof the givenRun.
-