001/* Copyright (C) 2014 konik.io
002 *
003 * This file is part of the Konik library.
004 *
005 * The Konik library is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * The Konik library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with the Konik library. If not, see <http://www.gnu.org/licenses/>.
017 */
018package io.konik.zugferd.unqualified;
019
020import io.konik.validator.annotation.NotBlank;
021
022import javax.xml.bind.annotation.XmlAttribute;
023import javax.xml.bind.annotation.XmlSchemaType;
024import javax.xml.bind.annotation.XmlType;
025import javax.xml.bind.annotation.XmlValue;
026import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
027import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
028
029/**
030 * = The Identifier.
031 */
032@XmlType(name = "IDType", propOrder = { "value" })
033public class ID {
034
035   @XmlValue
036   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
037   @XmlSchemaType(name = "token")
038   private String value;
039
040   @XmlAttribute(name = "schemeID")
041   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
042   @XmlSchemaType(name = "token")
043   private String schemeId;
044
045   /** Instantiates a new id. */
046   public ID() {
047   }
048
049   /**
050    * Instantiates a new id with value and a null scheme.
051    *
052    * @param value the value
053    */
054   public ID(String value) {
055      this.value = value;
056   }
057
058   /**
059    * Instantiates a new id with value and scheme id.
060    * 
061    * @param value the value
062    * @param schemeId the scheme id
063    */
064   public ID(String value, String schemeId) {
065      this.value = value;
066      this.schemeId = schemeId;
067   }
068
069   /**
070    * Gets the value.
071    * 
072    * @return the value
073    */
074   @NotBlank
075   public String getValue() {
076      return value;
077   }
078
079   /**
080    * Sets the value.
081    * 
082    * @param value the new value
083    */
084   public void setValue(String value) {
085      this.value = value;
086   }
087
088   /**
089    * Gets the scheme id.
090    * 
091    * @return the scheme id
092    */
093   public String getSchemeId() {
094      return schemeId;
095   }
096
097   /**
098    * Sets the scheme id.
099    * 
100    * @param schemeId the new scheme id
101    */
102   public void setSchemeId(String schemeId) {
103      this.schemeId = schemeId;
104   }
105}