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

com.github.matheusesoft.alm.api.model.Field Maven / Gradle / Ivy

The newest version!
package com.github.matheusesoft.alm.api.model;

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

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "Field")
@XmlAccessorType(XmlAccessType.FIELD)
public class Field
{
    @XmlElement(name = "Value", required = true)
    private List values;

    @XmlAttribute(name = "Name", required = true)
    private String name;

    public Field()
    {
    }

    public Field(String name)
    {
        name(name);
    }

    public Field(String name, String value)
    {
        name(name);
        value(value);
    }

    public List values()
    {
        if (values == null)
        {
            values = new ArrayList();
        }

        return values;
    }

    public String value()
    {
        return values().isEmpty() ? null : values().get(0);
    }

    public void value(String value)
    {
        values().clear();
        values().add(value);
    }

    public String name()
    {
        return name;
    }

    public void name(String value)
    {
        name = value;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy