Update year in copyright lines
[Sone.git] / src / main / java / net / pterodactylus / sone / freenet / wot / Context.java
index 0f730fa..b386bdb 100644 (file)
@@ -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
 
 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 <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
 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) {