
nl.tweeenveertig.openstack.information.AbstractInformation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of joss Show documentation
Show all versions of joss Show documentation
Java Client library for OpenStack Storage (Swift)
package nl.tweeenveertig.openstack.information;
import nl.tweeenveertig.openstack.headers.Header;
import nl.tweeenveertig.openstack.headers.Metadata;
import java.util.Collection;
import java.util.Map;
import java.util.TreeMap;
public abstract class AbstractInformation {
private Map metadataHeaders = new TreeMap();
public void clear() {
metadataHeaders.clear();
}
public void addMetadata(Metadata metadata) {
metadataHeaders.put(metadata.getName(), metadata);
}
public String getMetadata(String name) {
return this.metadataHeaders.get(name) != null ? this.metadataHeaders.get(name).getHeaderValue() : null;
}
public Collection getMetadata() {
return this.metadataHeaders.values();
}
public void setMetadata(Map metadataHeaders) {
this.metadataHeaders = metadataHeaders;
}
}