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   @NotBlank
036   @XmlValue
037   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
038   @XmlSchemaType(name = "token")
039   private String value;
040
041   @XmlAttribute(name = "schemeID")
042   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
043   @XmlSchemaType(name = "token")
044   private String schemeId;
045
046   /** Instantiates a new id. */
047   public ID() {
048   }
049
050   /**
051    * Instantiates a new id with value and a null scheme.
052    *
053    * @param value the value
054    */
055   public ID(String value) {
056      this.value = value;
057   }
058
059   /**
060    * Instantiates a new id with value and scheme id.
061    * 
062    * @param value the value
063    * @param schemeId the scheme id
064    */
065   public ID(String value, String schemeId) {
066      this.value = value;
067      this.schemeId = schemeId;
068   }
069
070   /**
071    * Gets the value.
072    * 
073    * @return the value
074    */
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}