@@ -34,32 +34,30 @@ public final class EnrichPolicy implements Writeable, ToXContentFragment {
34
34
public static final String EXACT_MATCH_TYPE = "exact_match" ;
35
35
public static final String [] SUPPORTED_POLICY_TYPES = new String []{EXACT_MATCH_TYPE };
36
36
37
- static final ParseField TYPE = new ParseField ("type" );
38
- static final ParseField QUERY = new ParseField ("query" );
39
- static final ParseField INDICES = new ParseField ("indices" );
40
- static final ParseField ENRICH_KEY = new ParseField ("enrich_key" );
41
- static final ParseField ENRICH_VALUES = new ParseField ("enrich_values" );
42
- static final ParseField SCHEDULE = new ParseField ("schedule" );
37
+ private static final ParseField TYPE = new ParseField ("type" );
38
+ private static final ParseField QUERY = new ParseField ("query" );
39
+ private static final ParseField INDICES = new ParseField ("indices" );
40
+ private static final ParseField ENRICH_KEY = new ParseField ("enrich_key" );
41
+ private static final ParseField ENRICH_VALUES = new ParseField ("enrich_values" );
42
+ private static final ParseField SCHEDULE = new ParseField ("schedule" );
43
43
44
44
@ SuppressWarnings ("unchecked" )
45
- static final ConstructingObjectParser <EnrichPolicy , Void > PARSER = new ConstructingObjectParser <>("policy" ,
46
- args -> {
47
- return new EnrichPolicy (
48
- (String ) args [0 ],
49
- (QuerySource ) args [1 ],
50
- (List <String >) args [2 ],
51
- (String ) args [3 ],
52
- (List <String >) args [4 ],
53
- (String ) args [5 ]
54
- );
55
- }
45
+ private static final ConstructingObjectParser <EnrichPolicy , Void > PARSER = new ConstructingObjectParser <>("policy" ,
46
+ args -> new EnrichPolicy (
47
+ (String ) args [0 ],
48
+ (QuerySource ) args [1 ],
49
+ (List <String >) args [2 ],
50
+ (String ) args [3 ],
51
+ (List <String >) args [4 ],
52
+ (String ) args [5 ]
53
+ )
56
54
);
57
55
58
56
static {
59
57
declareParserOptions (PARSER );
60
58
}
61
59
62
- private static void declareParserOptions (ConstructingObjectParser parser ) {
60
+ private static void declareParserOptions (ConstructingObjectParser <?, ?> parser ) {
63
61
parser .declareString (ConstructingObjectParser .constructorArg (), TYPE );
64
62
parser .declareObject (ConstructingObjectParser .optionalConstructorArg (), (p , c ) -> {
65
63
XContentBuilder contentBuilder = XContentBuilder .builder (p .contentType ().xContent ());
@@ -240,17 +238,15 @@ public static class NamedPolicy implements Writeable, ToXContent {
240
238
static final ParseField NAME = new ParseField ("name" );
241
239
@ SuppressWarnings ("unchecked" )
242
240
static final ConstructingObjectParser <NamedPolicy , Void > PARSER = new ConstructingObjectParser <>("named_policy" ,
243
- args -> {
244
- return new NamedPolicy (
245
- (String ) args [0 ],
246
- new EnrichPolicy ((String ) args [1 ],
247
- (QuerySource ) args [2 ],
248
- (List <String >) args [3 ],
249
- (String ) args [4 ],
250
- (List <String >) args [5 ],
251
- (String ) args [6 ])
252
- );
253
- }
241
+ args -> new NamedPolicy (
242
+ (String ) args [0 ],
243
+ new EnrichPolicy ((String ) args [1 ],
244
+ (QuerySource ) args [2 ],
245
+ (List <String >) args [3 ],
246
+ (String ) args [4 ],
247
+ (List <String >) args [5 ],
248
+ (String ) args [6 ])
249
+ )
254
250
);
255
251
256
252
static {
0 commit comments