X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FIdentity.java;h=e6f4f62b39c8e26aa3c609059edea6e0f4503ad0;hb=452b72e057f577c3b06389caf606b670ecc600c3;hp=d0cafc5ea84a6e1dea3d0304f4d0680a2a797c00;hpb=2d1bc900f1134faefb9701cf91729b9469167d0c;p=Sone.git
diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/Identity.java b/src/main/java/net/pterodactylus/sone/freenet/wot/Identity.java
index d0cafc5..e6f4f62 100644
--- a/src/main/java/net/pterodactylus/sone/freenet/wot/Identity.java
+++ b/src/main/java/net/pterodactylus/sone/freenet/wot/Identity.java
@@ -1,5 +1,5 @@
/*
- * Sone - Identity.java - Copyright © 2010â2013 David Roden
+ * Sone - Identity.java - Copyright © 2010â2020 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
@@ -17,36 +17,16 @@
package net.pterodactylus.sone.freenet.wot;
-import java.util.Collection;
-import java.util.Collections;
import java.util.Map;
import java.util.Set;
-import com.google.common.base.Function;
-
/**
* Interface for web of trust identities, defining all functions that can be
* performed on an identity. An identity is only a container for identity data
* and will not perform any updating in the WebOfTrust plugin itself.
- *
- * @author David âBombeâ Roden
*/
public interface Identity {
- public static final Function> TO_CONTEXTS = new Function>() {
- @Override
- public Set apply(Identity identity) {
- return (identity == null) ? Collections.emptySet() : identity.getContexts();
- }
- };
-
- public static final Function> TO_PROPERTIES = new Function>() {
- @Override
- public Map apply(Identity input) {
- return (input == null) ? Collections.emptyMap() : input.getProperties();
- }
- };
-
/**
* Returns the ID of the identity.
*
@@ -99,7 +79,7 @@ public interface Identity {
* @param contexts
* All contexts of the identity
*/
- public void setContexts(Collection contexts);
+ public void setContexts(Set contexts);
/**
* Removes the given context from this identity.
@@ -151,6 +131,8 @@ public interface Identity {
*/
public Identity removeProperty(String name);
+ Map getTrust();
+
/**
* Retrieves the trust that this identity receives from the given own
* identity. If this identity is not in the own identityâs trust tree, a