Add empty binder to GlobalResolver by copybara-service[bot] · Pull Request #586 · cel-expr/cel-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions runtime/src/main/java/dev/cel/runtime/Activation.java
15 changes: 15 additions & 0 deletions runtime/src/main/java/dev/cel/runtime/GlobalResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,25 @@
*
* <p>CEL Library Internals. Do Not Use.
*/
@SuppressWarnings("AndroidJdkLibsChecker") // FunctionalInterface added in 24
@FunctionalInterface
@Internal
public interface GlobalResolver {

/** An empty binder which resolves everything to null. */
GlobalResolver EMPTY =
new GlobalResolver() {
@Override
public @Nullable Object resolve(String name) {
return null;
}

@Override
public String toString() {
return "{}";
}
};

/** Resolves the given name to its value. Returns null if resolution fails. */
@Nullable Object resolve(String name);
}