Cache NodeContextSuppliers in CodecDataObject
[mdsal.git] / binding / mdsal-binding-dom-codec / src / main / java / org / opendaylight / mdsal / binding / dom / codec / impl / NodeContextSupplier.java
index 76d40c23c8bf9782ad6aa34c05b255ce5d234f5a..b9c84703f2f0f18fdad32e3934e03b123c46353f 100644 (file)
@@ -7,13 +7,16 @@
  */
 package org.opendaylight.mdsal.binding.dom.codec.impl;
 
-import java.util.function.Supplier;
-import org.eclipse.jdt.annotation.NonNull;
+import com.google.common.annotations.Beta;
+import org.eclipse.jdt.annotation.NonNullByDefault;
 
 /**
- * Type capture of an entity producing NodeCodecContexts.
+ * Type capture of an entity producing NodeCodecContexts. Implementations are required to perform memoization. This
+ * interface does not form API surface and is exposed only for generated code. It can change at any time.
  */
-interface NodeContextSupplier extends Supplier<NodeCodecContext> {
-    @Override
-    @NonNull NodeCodecContext get();
+@Beta
+@FunctionalInterface
+@NonNullByDefault
+public interface NodeContextSupplier {
+    NodeCodecContext get();
 }