Skip to content

Commit

Permalink
spotlessApply
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Oct 31, 2024
1 parent 6a930ad commit a9a90ab
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@

package org.opensearch.client.codegen.model;

import org.opensearch.client.codegen.model.overrides.ShouldGenerate;

import java.util.Collection;
import java.util.List;
import org.opensearch.client.codegen.model.overrides.ShouldGenerate;

public class ArrayShape extends ObjectShape {
private final Field valueBodyField;

public ArrayShape(Namespace parent, String className, Type arrayType, String typedefName, String description, ShouldGenerate shouldGenerate) {
public ArrayShape(
Namespace parent,
String className,
Type arrayType,
String typedefName,
String description,
ShouldGenerate shouldGenerate
) {
super(parent, className, typedefName, description, shouldGenerate);
this.valueBodyField = new Field("_value_body", arrayType, true, "Response value.", null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

package org.opensearch.client.codegen.model;

import org.opensearch.client.codegen.model.overrides.ShouldGenerate;

import java.util.Collection;
import java.util.List;
import org.opensearch.client.codegen.model.overrides.ShouldGenerate;

public class DictionaryResponseShape extends Shape {
private final Type keyType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.Set;
import java.util.TreeMap;
import javax.annotation.Nullable;

import org.opensearch.client.codegen.model.overrides.ShouldGenerate;
import org.opensearch.client.codegen.utils.JavaClassKind;
import org.opensearch.client.codegen.utils.Markdown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ private static class Client extends Shape {
private final Collection<RequestShape> operations;

private Client(Namespace parent, boolean async, boolean base, Collection<RequestShape> operations) {
super(parent, parent.getClientClassName(async, base), null, "Client for the " + parent.name + " namespace.", ShouldGenerate.Always);
super(
parent,
parent.getClientClassName(async, base),
null,
"Client for the " + parent.name + " namespace.",
ShouldGenerate.Always
);
this.async = async;
this.base = base;
this.operations = operations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public class RequestShape extends ObjectShape {
private final Map<String, Field> fields = new TreeMap<>();
private boolean isBooleanRequest;

public RequestShape(@Nonnull Namespace parent, @Nonnull OperationGroup operationGroup, @Nullable String description, @Nonnull ShouldGenerate shouldGenerate) {
public RequestShape(
@Nonnull Namespace parent,
@Nonnull OperationGroup operationGroup,
@Nullable String description,
@Nonnull ShouldGenerate shouldGenerate
) {
super(parent, requestClassName(operationGroup), operationGroup.asTypedefPrefix() + ".Request", description, shouldGenerate);
this.operationGroup = operationGroup;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ private boolean shouldGenerate(Set<Shape> visited) {
return false;
}
visited.add(this);
return incomingReferences.values().stream()
.flatMap(List::stream)
.anyMatch(s -> s.shouldGenerate(visited));
return incomingReferences.values().stream().flatMap(List::stream).anyMatch(s -> s.shouldGenerate(visited));
default:
throw new IllegalStateException("Unknown ShouldGenerate: " + shouldGenerate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@ private void visit(@Nonnull OperationGroup group, @Nonnull List<OpenApiOperation
return;
}

visit(parent, requestShape.getResponseType().getName(), group + ".Response", responseSchema.orElse(OpenApiSchema.ANONYMOUS_OBJECT), ShouldGenerate.Always);
visit(
parent,
requestShape.getResponseType().getName(),
group + ".Response",
responseSchema.orElse(OpenApiSchema.ANONYMOUS_OBJECT),
ShouldGenerate.Always
);
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ public class TaggedUnionShape extends Shape {
private final Map<String, Variant> variants = new TreeMap<>();
private final String discriminatingField;

public TaggedUnionShape(Namespace parent, String className, String typedefName, String description, String discriminatingField, ShouldGenerate shouldGenerate) {
public TaggedUnionShape(
Namespace parent,
String className,
String typedefName,
String description,
String discriminatingField,
ShouldGenerate shouldGenerate
) {
super(parent, className, typedefName, description, shouldGenerate);
this.discriminatingField = discriminatingField;
}
Expand Down

0 comments on commit a9a90ab

Please sign in to comment.