Skip to content

Commit

Permalink
[codegen] update codegen tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelprazak committed Jul 19, 2022
1 parent 67301fe commit 9062a43
Show file tree
Hide file tree
Showing 79 changed files with 1,894 additions and 2,262 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,14 @@ public final class CompositePathResponse {
* @return Sort order for composite paths.
*
*/
private final @Nullable String order;
private @Nullable String order;
/**
* @return The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*)
*
*/
private final @Nullable String path;

@CustomType.Constructor
private CompositePathResponse(
@CustomType.Parameter("order") @Nullable String order,
@CustomType.Parameter("path") @Nullable String path) {
this.order = order;
this.path = path;
}
private @Nullable String path;

private CompositePathResponse() {}
/**
* @return Sort order for composite paths.
*
Expand All @@ -52,30 +45,32 @@ public static Builder builder() {
public static Builder builder(CompositePathResponse defaults) {
return new Builder(defaults);
}

@CustomType.Builder
public static final class Builder {
private @Nullable String order;
private @Nullable String path;

public Builder() {
// Empty
}

public Builder() {}
public Builder(CompositePathResponse defaults) {
Objects.requireNonNull(defaults);
this.order = defaults.order;
this.path = defaults.path;
}

@CustomType.Setter
public Builder order(@Nullable String order) {
this.order = order;
return this;
}
@CustomType.Setter
public Builder path(@Nullable String path) {
this.path = path;
return this;
} public CompositePathResponse build() {
return new CompositePathResponse(order, path);
}
public CompositePathResponse build() {
final var o = new CompositePathResponse();
o.order = order;
o.path = path;
return o;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ public final class IndexingPolicyResponse {
* @return List of composite path list
*
*/
private final @Nullable List<List<CompositePathResponse>> compositeIndexes;

@CustomType.Constructor
private IndexingPolicyResponse(@CustomType.Parameter("compositeIndexes") @Nullable List<List<CompositePathResponse>> compositeIndexes) {
this.compositeIndexes = compositeIndexes;
}
private @Nullable List<List<CompositePathResponse>> compositeIndexes;

private IndexingPolicyResponse() {}
/**
* @return List of composite path list
*
Expand All @@ -37,24 +33,24 @@ public static Builder builder() {
public static Builder builder(IndexingPolicyResponse defaults) {
return new Builder(defaults);
}

@CustomType.Builder
public static final class Builder {
private @Nullable List<List<CompositePathResponse>> compositeIndexes;

public Builder() {
// Empty
}

public Builder() {}
public Builder(IndexingPolicyResponse defaults) {
Objects.requireNonNull(defaults);
this.compositeIndexes = defaults.compositeIndexes;
}

@CustomType.Setter
public Builder compositeIndexes(@Nullable List<List<CompositePathResponse>> compositeIndexes) {
this.compositeIndexes = compositeIndexes;
return this;
} public IndexingPolicyResponse build() {
return new IndexingPolicyResponse(compositeIndexes);
}
public IndexingPolicyResponse build() {
final var o = new IndexingPolicyResponse();
o.compositeIndexes = compositeIndexes;
return o;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ public final class SqlContainerGetPropertiesResponseResource {
* @return The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container
*
*/
private final @Nullable IndexingPolicyResponse indexingPolicy;

@CustomType.Constructor
private SqlContainerGetPropertiesResponseResource(@CustomType.Parameter("indexingPolicy") @Nullable IndexingPolicyResponse indexingPolicy) {
this.indexingPolicy = indexingPolicy;
}
private @Nullable IndexingPolicyResponse indexingPolicy;

private SqlContainerGetPropertiesResponseResource() {}
/**
* @return The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container
*
Expand All @@ -37,24 +33,24 @@ public static Builder builder() {
public static Builder builder(SqlContainerGetPropertiesResponseResource defaults) {
return new Builder(defaults);
}

@CustomType.Builder
public static final class Builder {
private @Nullable IndexingPolicyResponse indexingPolicy;

public Builder() {
// Empty
}

public Builder() {}
public Builder(SqlContainerGetPropertiesResponseResource defaults) {
Objects.requireNonNull(defaults);
this.indexingPolicy = defaults.indexingPolicy;
}

@CustomType.Setter
public Builder indexingPolicy(@Nullable IndexingPolicyResponse indexingPolicy) {
this.indexingPolicy = indexingPolicy;
return this;
} public SqlContainerGetPropertiesResponseResource build() {
return new SqlContainerGetPropertiesResponseResource(indexingPolicy);
}
public SqlContainerGetPropertiesResponseResource build() {
final var o = new SqlContainerGetPropertiesResponseResource();
o.indexingPolicy = indexingPolicy;
return o;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@

@CustomType
public final class TopLevel {
private final @Nullable String buzz;

@CustomType.Constructor
private TopLevel(@CustomType.Parameter("buzz") @Nullable String buzz) {
this.buzz = buzz;
}
private @Nullable String buzz;

private TopLevel() {}
public Optional<String> buzz() {
return Optional.ofNullable(this.buzz);
}
Expand All @@ -29,24 +25,24 @@ public static Builder builder() {
public static Builder builder(TopLevel defaults) {
return new Builder(defaults);
}

@CustomType.Builder
public static final class Builder {
private @Nullable String buzz;

public Builder() {
// Empty
}

public Builder() {}
public Builder(TopLevel defaults) {
Objects.requireNonNull(defaults);
this.buzz = defaults.buzz;
}

@CustomType.Setter
public Builder buzz(@Nullable String buzz) {
this.buzz = buzz;
return this;
} public TopLevel build() {
return new TopLevel(buzz);
}
public TopLevel build() {
final var o = new TopLevel();
o.buzz = buzz;
return o;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,12 @@

@CustomType
public final class Container {
private final @Nullable ContainerBrightness brightness;
private final @Nullable String color;
private final @Nullable String material;
private final ContainerSize size;

@CustomType.Constructor
private Container(
@CustomType.Parameter("brightness") @Nullable ContainerBrightness brightness,
@CustomType.Parameter("color") @Nullable String color,
@CustomType.Parameter("material") @Nullable String material,
@CustomType.Parameter("size") ContainerSize size) {
this.brightness = brightness;
this.color = color;
this.material = material;
this.size = size;
}
private @Nullable ContainerBrightness brightness;
private @Nullable String color;
private @Nullable String material;
private ContainerSize size;

private Container() {}
public Optional<ContainerBrightness> brightness() {
return Optional.ofNullable(this.brightness);
}
Expand All @@ -50,17 +39,13 @@ public static Builder builder() {
public static Builder builder(Container defaults) {
return new Builder(defaults);
}

@CustomType.Builder
public static final class Builder {
private @Nullable ContainerBrightness brightness;
private @Nullable String color;
private @Nullable String material;
private ContainerSize size;

public Builder() {
// Empty
}

public Builder() {}
public Builder(Container defaults) {
Objects.requireNonNull(defaults);
this.brightness = defaults.brightness;
Expand All @@ -69,23 +54,33 @@ public Builder(Container defaults) {
this.size = defaults.size;
}

@CustomType.Setter
public Builder brightness(@Nullable ContainerBrightness brightness) {
this.brightness = brightness;
return this;
}
@CustomType.Setter
public Builder color(@Nullable String color) {
this.color = color;
return this;
}
@CustomType.Setter
public Builder material(@Nullable String material) {
this.material = material;
return this;
}
@CustomType.Setter
public Builder size(ContainerSize size) {
this.size = Objects.requireNonNull(size);
return this;
} public Container build() {
return new Container(brightness, color, material, size);
}
public Container build() {
final var o = new Container();
o.brightness = brightness;
o.color = color;
o.material = material;
o.size = size;
return o;
}
}
}
Loading

0 comments on commit 9062a43

Please sign in to comment.