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

com.lyncode.xoai.model.oaipmh.Set Maven / Gradle / Ivy

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147 
// See client://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2012.01.13 at 08:24:23 PM WET 
//

package com.lyncode.xoai.model.oaipmh;

import com.lyncode.xml.exceptions.XmlWriteException;
import com.lyncode.xoai.model.xoai.XOAIMetadata;
import com.lyncode.xoai.xml.XmlWritable;
import com.lyncode.xoai.xml.XmlWriter;

import java.util.ArrayList;
import java.util.List;

public class Set implements XmlWritable {

    private String spec;
    private String name;
    private List descriptions = new ArrayList();

    public String getSpec() {
        return spec;
    }

    public Set withSpec(String value) {
        this.spec = value;
        return this;
    }

    public String getName() {
        return name;
    }

    public Set withName(String value) {
        this.name = value;
        return this;
    }

    public List getDescriptions() {
        return this.descriptions;
    }

    public Set withDescription(XOAIMetadata description) {
        this.descriptions.add(new Description(description));
        return this;
    }

    @Override
    public void write(XmlWriter writer) throws XmlWriteException {
        writer.writeElement("setSpec", spec);
        writer.writeElement("setName", name);
        if (this.descriptions != null && !this.descriptions.isEmpty()) {
            for (Description desc : this.descriptions)
                writer.writeElement("setDescription", desc);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy