projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
🔀 Merge branch “release-80”
[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
..
b386bdb
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/freenet/wot/Context.java
+++ b/
src/main/java/net/pterodactylus/sone/freenet/wot/Context.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - Context.java - Copyright © 2014 David Roden
+ * Sone - Context.java - Copyright © 2014
–2019
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
*
* 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,14
+17,24
@@
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.
- *
- * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
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) {