2 * jFCPlib - Identity.java - Copyright © 2009–2016 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.fcp.plugin;
21 * Wrapper around a web-of-trust identity.
23 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
25 public class Identity {
27 /** The identity’s identifier. */
28 private final String identifier;
30 /** The identity’s nickname. */
31 private final String nickname;
33 /** The identity’s request URI. */
34 private final String requestUri;
37 * Creates a new identity.
40 * The identifies of the identity
42 * The nickname of the identity
44 * The request URI of the identity
46 public Identity(String identifier, String nickname, String requestUri) {
47 this.identifier = identifier;
48 this.nickname = nickname;
49 this.requestUri = requestUri;
53 * Returns the identifier of this identity.
55 * @return This identity’s identifier
57 public String getIdentifier() {
62 * Returns the nickname of this identity.
64 * @return This identity’s nickname
66 public String getNickname() {
71 * Returns the request URI of this identity.
73 * @return This identity’s request URI
75 public String getRequestUri() {
83 public boolean equals(Object obj) {
84 if ((obj == null) || (obj.getClass() != this.getClass())) {
87 Identity identity = (Identity) obj;
88 return identifier.equals(identity.identifier);
95 public int hashCode() {
96 return identifier.hashCode();