X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FContext.java;h=b386bdb446d5c32defd7efeefc4b878c4b506491;hb=41ca6590c4a7372cb4f687f6e3cfdc2fab232703;hp=0f730fafcaad960272a55701b62448d0df4cc443;hpb=88469a40e677180866ae22f991dd547d0a367522;p=Sone.git
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
--- 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
@@ -17,14 +17,24 @@
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.
- *
- * @author David âBombeâ Roden
*/
public class Context {
+ public static final Function extractContext = new Function() {
+ @Nullable
+ @Override
+ public String apply(@Nullable Context context) {
+ return (context == null) ? null : context.getContext();
+ }
+ };
+
private final String context;
public Context(String context) {