11package org .opensearch .action .admin .indices .view ;
22
3- import java .io .IOException ;
4- import java .util .ArrayList ;
5- import java .util .List ;
6- import java .util .Objects ;
7-
83import org .opensearch .action .ActionRequestValidationException ;
94import org .opensearch .action .ActionType ;
105import org .opensearch .action .ValidateActions ;
3429import org .opensearch .threadpool .ThreadPool ;
3530import org .opensearch .transport .TransportService ;
3631
32+ import java .io .IOException ;
33+ import java .util .ArrayList ;
34+ import java .util .List ;
35+ import java .util .Objects ;
36+
3737/** Action to create a view */
3838public class CreateViewAction extends ActionType <CreateViewAction .Response > {
3939
@@ -83,11 +83,9 @@ public boolean equals(Object o) {
8383 if (this == o ) return true ;
8484 if (o == null || getClass () != o .getClass ()) return false ;
8585 Request that = (Request ) o ;
86- return name .equals (that .name )
87- && description .equals (that .description )
88- && targets .equals (that .targets );
86+ return name .equals (that .name ) && description .equals (that .description ) && targets .equals (that .targets );
8987 }
90-
88+
9189 @ Override
9290 public int hashCode () {
9391 return Objects .hash (name , description , targets );
@@ -142,7 +140,7 @@ public boolean equals(Object o) {
142140 Target that = (Target ) o ;
143141 return indexPattern .equals (that .indexPattern );
144142 }
145-
143+
146144 @ Override
147145 public int hashCode () {
148146 return Objects .hash (indexPattern );
@@ -170,7 +168,7 @@ public ActionRequestValidationException validate() {
170168 static {
171169 PARSER .declareString (ConstructingObjectParser .constructorArg (), View .Target .INDEX_PATTERN_FIELD );
172170 }
173-
171+
174172 public static Target fromXContent (final XContentParser parser ) throws IOException {
175173 return PARSER .parse (parser , null );
176174 }
@@ -187,7 +185,7 @@ public static Target fromXContent(final XContentParser parser) throws IOExceptio
187185 PARSER .declareString (ConstructingObjectParser .optionalConstructorArg (), View .DESCRIPTION_FIELD );
188186 PARSER .declareObjectArray (ConstructingObjectParser .constructorArg (), (p , c ) -> Target .fromXContent (p ), View .TARGETS_FIELD );
189187 }
190-
188+
191189 public static Request fromXContent (final XContentParser parser ) throws IOException {
192190 return PARSER .parse (parser , null );
193191 }
@@ -197,7 +195,7 @@ public static Request fromXContent(final XContentParser parser) throws IOExcepti
197195 @ ExperimentalApi
198196 public static class Response extends ActionResponse implements ToXContentObject {
199197
200- private final View createdView ;
198+ private final View createdView ;
201199
202200 public Response (final View createdView ) {
203201 this .createdView = createdView ;
@@ -220,7 +218,7 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa
220218 builder .endObject ();
221219 return builder ;
222220 }
223-
221+
224222 private static final ConstructingObjectParser <Response , Void > PARSER = new ConstructingObjectParser <>(
225223 "create_view_response" ,
226224 args -> new Response ((View ) args [0 ])
0 commit comments