3 * Copyright © 2008 David Roden
5 * This program 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 2 of the License, or
8 * (at your option) any later version.
10 * This program 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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.fcp;
23 * Container for ARKs (address resolution keys).
25 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
29 /** The public URI of the ARK. */
30 private final String publicURI;
32 /** The private URI of the ARK. */
33 private final String privateURI;
35 /** The number of the ARK. */
36 private final int number;
39 * Creates a new ARK with the given URI and number.
42 * The public URI of the ARK
44 * The number of the ARK
46 public ARK(String publicURI, String number) {
47 this(publicURI, null, number);
51 * Creates a new ARK with the given URIs and number.
54 * The public URI of the ARK
56 * The private URI of the ARK
58 * The number of the ARK
60 public ARK(String publicURI, String privateURI, String number) {
61 if ((publicURI == null) || (number == null)) {
62 throw new NullPointerException(((publicURI == null) ? "publicURI" : "number") + " must not be null");
64 this.publicURI = publicURI;
65 this.privateURI = privateURI;
67 this.number = Integer.valueOf(number);
68 } catch (NumberFormatException nfe1) {
69 throw new IllegalArgumentException("number must be numeric", nfe1);
74 * Returns the public URI of the ARK.
76 * @return The public URI of the ARK
78 public String getPublicURI() {
83 * Returns the private URI of the ARK.
85 * @return The private URI of the ARK
87 public String getPrivateURI() {
92 * Returns the number of the ARK.
94 * @return The number of the ARK
96 public int getNumber() {