public class MetadataContainer
extends hudson.model.InvisibleAction
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 and Description |
---|
MetadataContainer() |
Modifier and Type | Method and Description |
---|---|
MetadataContainer |
add(MetadataValue mv)
Add a
MetadataValue to this container. |
<T extends MetadataValue> |
addAll(Iterable<T> mvs)
add a list of elements |
<T extends MetadataValue> |
deserialize(Class<T> clazz,
String serialized) |
com.google.common.collect.Multimap<String,MetadataValue> |
getMetadata() |
static com.google.common.collect.Multimap<String,MetadataValue> |
getMetadata(hudson.model.AbstractBuild<?,?> build) |
Map<String,String> |
getSerializedMetadata() |
<T extends MetadataValue> |
listDeserialize(Class<T> clazz,
String serialized) |
<T extends MetadataValue> |
listSerialize(Iterable<T> values) |
static MetadataContainer |
of(hudson.model.AbstractBuild<?,?> build) |
void |
removeAll(String key)
remove a list of elements |
String |
serialize(MetadataValue metadataValue) |
public com.google.common.collect.Multimap<String,MetadataValue> getMetadata()
public MetadataContainer add(MetadataValue mv)
MetadataValue
to this container.mv
- the given MetadataValue
to add.MetadataContainer
.public <T extends MetadataValue> MetadataContainer addAll(Iterable<T> mvs)
add
a list of elementspublic void removeAll(String key)
remove
a list of elementspublic Map<String,String> getSerializedMetadata()
public static MetadataContainer of(hudson.model.AbstractBuild<?,?> build)
build
- a given build.MetadataContainer
for the given build.public String serialize(MetadataValue metadataValue) throws MetadataSerializationException
metadataValue
- the metadata value to be serialized.MetadataValue
.MetadataSerializationException
- when serialization runs into problem.public <T extends MetadataValue> String listSerialize(Iterable<T> values)
values
- the metadata values to be serialized.MetadataValue
.MetadataSerializationException
- when serialization runs into problem.public <T extends MetadataValue> T deserialize(Class<T> clazz, String serialized)
clazz
- class of the MetadataValue
object to be deserialized.serialized
- the string to deserialize.MetadataValue
object.public <T extends MetadataValue> Iterable<T> listDeserialize(Class<T> clazz, String serialized)
clazz
- the class of the MetadataValue
to be deserialize.serialized
- the serialized form to be deserialized.public static com.google.common.collect.Multimap<String,MetadataValue> getMetadata(hudson.model.AbstractBuild<?,?> build)
build
- a given AbstractBuild
.MetadataContainer
of the
given AbstractBuild
.Copyright © 2004-2014. All Rights Reserved.