/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TestRest.converter;

import TestRest.converter.MagConverter;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.List;
import java.util.ArrayList;
/**
 *
 * @author aparnab
 */
@XmlType(propOrder={"originID","value","type"})
public class NetMagConverter {

    
    @XmlElement(name="mag")
    private List<MagConverter> value;
    @XmlAttribute
    private String publicID;
    
    private String originID;
    private String type;

    public NetMagConverter(){
    }
    public NetMagConverter(float magValue){
        MagConverter temp;
        value = new ArrayList<MagConverter>();
        temp = new MagConverter();
        temp.setValue(magValue);
        value.add(temp);

    }
    /*
    public Double getValue() {
        return this.value.;
    }
    public void setValue(Double ivalue){
        this.value.get(0).setValue(ivalue);
    }
    */
    public String getOriginID(){
        return this.originID;
    }
    public void setOriginID(String iOriginID){
        this.originID = "smi:data.scec.org/origin/" + iOriginID;
    }

    public String getType() {
        return this.type;
    }
    public void setType(String itype){
        this.type = itype;
    }
    public String getPublicID() {
        return this.publicID;
    }
    //public void setPublicID(Long imagid){
    public void setPublicID(Long evid){
        //this.publicID = "smi:data.scec.org/event/" + imagid.toString() + "/magnitude";
        this.publicID = "smi:data.scec.org/event/" + evid.toString() + "/magnitude";
    }
}
