X-Git-Url: https://git.pterodactylus.net/?p=jFCPlib.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fplugin%2FWebOfTrustPlugin.java;h=e83b071c9d831fe1892a0fefed8120c27c247ea8;hp=3e99b1ef10a0e7edf6f91ac9f5baf3c6a756c0af;hb=b24e200b9bf51038f951d6451f8a65c98115f1c1;hpb=4d15688f01e941e5ca67c8d80e05596ea9d0ac6e diff --git a/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java b/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java index 3e99b1e..e83b071 100644 --- a/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java +++ b/src/main/java/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java @@ -1,5 +1,5 @@ /* - * jFCPlib - WebOfTrustPlugin.java - Copyright © 2009 David Roden + * jFCPlib - WebOfTrustPlugin.java - Copyright © 2009–2014 David Roden * * 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 @@ -429,233 +429,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; - } - - } - }