From 259cf1ff3a6a0fddbfbda776501132a702056897 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 13 Nov 2016 23:33:12 -0800 Subject: [PATCH] Mark NetworkTablesJNI callback interfaces as FunctionalInterface. (#154) This allows them to be used in Java 8 lambdas. --- .../edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java index 236e7c0c71..0271d511ac 100644 --- a/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java +++ b/java/src/edu/wpi/first/wpilibj/networktables/NetworkTablesJNI.java @@ -124,12 +124,14 @@ public class NetworkTablesJNI { public static native void flush(); + @FunctionalInterface public interface EntryListenerFunction { void apply(int uid, String key, Object value, int flags); } public static native int addEntryListener(String prefix, EntryListenerFunction listener, int flags); public static native void removeEntryListener(int entryListenerUid); + @FunctionalInterface public interface ConnectionListenerFunction { void apply(int uid, boolean connected, ConnectionInfo conn); } @@ -165,6 +167,7 @@ public class NetworkTablesJNI { public static native long now(); + @FunctionalInterface public interface LoggerFunction { void apply(int level, String file, int line, String msg); }