X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fplugin%2FWebOfTrustPlugin.java;h=22584ee6ebc50f8c673f3c9695993079bc0f5709;hb=a30d521e1add957b2ddfee455bc6e061efbf44b7;hp=3e99b1ef10a0e7edf6f91ac9f5baf3c6a756c0af;hpb=508624458578f01a393f8b44f32b98b40054fdc8;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java b/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java index 3e99b1e..22584ee 100644 --- a/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java +++ b/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java @@ -1,9 +1,9 @@ /* - * jFCPlib - WebOfTrustPlugin.java - Copyright © 2009 David Roden + * jFCPlib - WebOfTrustPlugin.java - Copyright © 2009–2016 David Roden * - * This program is free software; you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -12,8 +12,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with this program. If not, see . */ package net.pterodactylus.fcp.plugin; @@ -429,233 +428,4 @@ public class WebOfTrustPlugin { return parameterMap; } - /** - * Wrapper around a web-of-trust identity. - * - * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - */ - public static class Identity { - - /** The identity’s identifier. */ - private final String identifier; - - /** The identity’s nickname. */ - private final String nickname; - - /** The identity’s request URI. */ - private final String requestUri; - - /** - * Creates a new identity. - * - * @param identifier - * The identifies of the identity - * @param nickname - * The nickname of the identity - * @param requestUri - * The request URI of the identity - */ - public Identity(String identifier, String nickname, String requestUri) { - this.identifier = identifier; - this.nickname = nickname; - this.requestUri = requestUri; - } - - /** - * Returns the identifier of this identity. - * - * @return This identity’s identifier - */ - public String getIdentifier() { - return identifier; - } - - /** - * Returns the nickname of this identity. - * - * @return This identity’s nickname - */ - public String getNickname() { - return nickname; - } - - /** - * Returns the request URI of this identity. - * - * @return This identity’s request URI - */ - public String getRequestUri() { - return requestUri; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(Object obj) { - if ((obj == null) || (obj.getClass() != this.getClass())) { - return false; - } - Identity identity = (Identity) obj; - return identifier.equals(identity.identifier); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return identifier.hashCode(); - } - - } - - /** - * Container for the trust given from one identity to another. - * - * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - */ - public static class IdentityTrust { - - /** The trust given to the identity. */ - private final byte trust; - - /** The command for the trust value. */ - private final String comment; - - /** - * Creates a new identity trust container. - * - * @param trust - * The trust given to the identity - * @param comment - * The comment for the trust value - */ - public IdentityTrust(byte trust, String comment) { - this.trust = trust; - this.comment = comment; - } - - /** - * Returns the trust value given to the identity. - * - * @return The trust value - */ - public byte getTrust() { - return trust; - } - - /** - * Returns the comment for the trust value. - * - * @return The comment for the trust value - */ - public String getComment() { - return comment; - } - - } - - /** - * Container that stores the trust that is calculated by taking all trustees - * and their trust lists into account. - * - * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - */ - public static class CalculatedTrust { - - /** The calculated trust value. */ - private final Byte trust; - - /** The calculated score value. */ - private final Integer score; - - /** The calculated rank. */ - private final Integer rank; - - /** - * Creates a new calculated trust container. - * - * @param trust - * The calculated trust value - * @param score - * The calculated score value - * @param rank - * The calculated rank of the - */ - public CalculatedTrust(Byte trust, Integer score, Integer rank) { - this.trust = trust; - this.score = score; - this.rank = rank; - } - - /** - * Returns the calculated trust value. - * - * @return The calculated trust value, or {@code null} if the trust - * value is not known - */ - public Byte getTrust() { - return trust; - } - - /** - * Returns the calculated score value. - * - * @return The calculated score value, or {@code null} if the score - * value is not known - */ - public Integer getScore() { - return score; - } - - /** - * Returns the calculated rank. - * - * @return The calculated rank, or {@code null} if the rank is not known - */ - public Integer getRank() { - return rank; - } - - } - - /** - * Wrapper around a web-of-trust own identity. - * - * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - */ - public static class OwnIdentity extends Identity { - - /** The identity’s insert URI. */ - private final String insertUri; - - /** - * Creates a new web-of-trust own identity. - * - * @param identifier - * The identifier of the identity - * @param nickname - * The nickname of the identity - * @param requestUri - * The request URI of the identity - * @param insertUri - * The insert URI of the identity - */ - public OwnIdentity(String identifier, String nickname, String requestUri, String insertUri) { - super(identifier, nickname, requestUri); - this.insertUri = insertUri; - } - - /** - * Returns the insert URI of this identity. - * - * @return This identity’s insert URI - */ - public String getInsertUri() { - return insertUri; - } - - } - }