Skip to content

Commit aea1607

Browse files
l46kokcopybara-github
authored andcommitted
Internal Changes
PiperOrigin-RevId: 944093766
1 parent 028e171 commit aea1607

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

checker/src/main/java/dev/cel/checker/CelStandardDeclarations.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,14 @@ public enum StringMatchers implements StandardOverload {
815815
SimpleType.STRING,
816816
SimpleType.STRING)),
817817
;
818+
819+
private static final ImmutableMap<String, StringMatchers> ID_TO_ENUM =
820+
stream(values()).collect(toImmutableMap(e -> e.celOverloadDecl().overloadId(), e -> e));
821+
822+
public static Optional<StringMatchers> fromOverloadId(String overloadId) {
823+
return Optional.ofNullable(ID_TO_ENUM.get(overloadId));
824+
}
825+
818826
private final CelOverloadDecl celOverloadDecl;
819827

820828
StringMatchers(CelOverloadDecl overloadDecl) {

0 commit comments

Comments
 (0)