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>
30 /** The public URI of the ARK. */
31 private final String publicURI;
33 /** The private URI of the ARK. */
34 private final String privateURI;
36 /** The number of the ARK. */
37 private final int number;
40 * Creates a new ARK with the given URI and number.
43 * The public URI of the ARK
45 * The number of the ARK
47 public ARK(String publicURI, String number) {
48 this(publicURI, null, number);
52 * Creates a new ARK with the given URIs and number.
55 * The public URI of the ARK
57 * The private URI of the ARK
59 * The number of the ARK
61 public ARK(String publicURI, String privateURI, String number) {
62 if ((publicURI == null) || (number == null)) {
63 throw new NullPointerException(((publicURI == null) ? "publicURI" : "number") + " must not be null");
65 this.publicURI = publicURI;
66 this.privateURI = privateURI;
68 this.number = Integer.valueOf(number);
69 } catch (NumberFormatException nfe1) {
70 throw new IllegalArgumentException("number must be numeric", nfe1);
75 * Returns the public URI of the ARK.
77 * @return The public URI of the ARK
79 public String getPublicURI() {
84 * Returns the private URI of the ARK.
86 * @return The private URI of the ARK
88 public String getPrivateURI() {
93 * Returns the number of the ARK.
95 * @return The number of the ARK
97 public int getNumber() {