All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.tweeenveertig.openstack.information.AbstractInformation Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
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;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy