@@ -52,7 +52,8 @@ public final class CelComprehensionsExtensions
5252 private static final TypeParamType TYPE_PARAM_V = TypeParamType .create ("V" );
5353 private static final MapType MAP_KV_TYPE = MapType .create (TYPE_PARAM_K , TYPE_PARAM_V );
5454
55- enum Function {
55+ /** Enumeration of functions for Comprehensions extension. */
56+ public enum Function {
5657 MAP_INSERT (
5758 CelFunctionDecl .newFunctionDeclaration (
5859 MAP_INSERT_FUNCTION ,
@@ -72,6 +73,10 @@ enum Function {
7273
7374 private final CelFunctionDecl functionDecl ;
7475
76+ public CelFunctionDecl functionDecl () {
77+ return functionDecl ;
78+ }
79+
7580 String getFunction () {
7681 return functionDecl .name ();
7782 }
@@ -81,20 +86,25 @@ String getFunction() {
8186 }
8287 }
8388
84- private static final CelExtensionLibrary <CelComprehensionsExtensions > LIBRARY =
85- new CelExtensionLibrary <CelComprehensionsExtensions >() {
86- private final CelComprehensionsExtensions version0 = new CelComprehensionsExtensions ();
89+ private static final class Library implements CelExtensionLibrary <CelComprehensionsExtensions > {
90+ private final CelComprehensionsExtensions version0 ;
91+
92+ Library () {
93+ version0 = new CelComprehensionsExtensions ();
94+ }
95+
96+ @ Override
97+ public String name () {
98+ return "comprehensions" ;
99+ }
87100
88- @ Override
89- public String name () {
90- return "comprehensions" ;
91- }
101+ @ Override
102+ public ImmutableSet <CelComprehensionsExtensions > versions () {
103+ return ImmutableSet .of (version0 );
104+ }
105+ }
92106
93- @ Override
94- public ImmutableSet <CelComprehensionsExtensions > versions () {
95- return ImmutableSet .of (version0 );
96- }
97- };
107+ private static final Library LIBRARY = new Library ();
98108
99109 static CelExtensionLibrary <CelComprehensionsExtensions > library () {
100110 return LIBRARY ;
@@ -103,7 +113,7 @@ static CelExtensionLibrary<CelComprehensionsExtensions> library() {
103113 private final ImmutableSet <Function > functions ;
104114
105115 CelComprehensionsExtensions () {
106- this .functions = ImmutableSet .copyOf (Function .values () );
116+ this .functions = ImmutableSet .of (Function .MAP_INSERT );
107117 }
108118
109119 @ Override
0 commit comments