projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove the possibility to create Sones from the getLocalSone() method.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
freenet
/
wot
/
Context.java
diff --git
a/src/main/java/net/pterodactylus/sone/freenet/wot/Context.java
b/src/main/java/net/pterodactylus/sone/freenet/wot/Context.java
index
0f730fa
..
f72e56d
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/freenet/wot/Context.java
+++ b/
src/main/java/net/pterodactylus/sone/freenet/wot/Context.java
@@
-17,6
+17,10
@@
package net.pterodactylus.sone.freenet.wot;
package net.pterodactylus.sone.freenet.wot;
+import javax.annotation.Nullable;
+
+import com.google.common.base.Function;
+
/**
* Custom container for the Web of Trust context. This allows easier
* configuration of dependency injection.
/**
* Custom container for the Web of Trust context. This allows easier
* configuration of dependency injection.
@@
-25,6
+29,14
@@
package net.pterodactylus.sone.freenet.wot;
*/
public class Context {
*/
public class Context {
+ public static final Function<Context, String> extractContext = new Function<Context, String>() {
+ @Nullable
+ @Override
+ public String apply(@Nullable Context context) {
+ return (context == null) ? null : context.getContext();
+ }
+ };
+
private final String context;
public Context(String context) {
private final String context;
public Context(String context) {