View Javadoc
1   /*
2    * This file is part of ***  M y C o R e  ***
3    * See http://www.mycore.de/ for details.
4    *
5    * MyCoRe is free software: you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation, either version 3 of the License, or
8    * (at your option) any later version.
9    *
10   * MyCoRe is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License
16   * along with MyCoRe.  If not, see <http://www.gnu.org/licenses/>.
17   */
18  
19  package org.mycore.pi.doi;
20  
21  import java.util.Locale;
22  
23  import org.mycore.pi.MCRPersistentIdentifier;
24  
25  public class MCRDigitalObjectIdentifier implements MCRPersistentIdentifier {
26  
27      public static final String TYPE = "doi";
28  
29      public static final String TEST_DOI_PREFIX = "10.5072";
30  
31      private String prefix;
32  
33      private String suffix;
34  
35      protected MCRDigitalObjectIdentifier(String prefix, String suffix) {
36          this.prefix = prefix;
37          this.suffix = suffix;
38      }
39  
40      public String getPrefix() {
41          return prefix;
42      }
43  
44      public String getSuffix() {
45          return suffix;
46      }
47  
48      @Override
49      public String asString() {
50          return String.format(Locale.ENGLISH, "%s/%s", prefix, suffix);
51      }
52  }