software.aws.awsprototypingsdk.nxmonorepo.SemverGroup Maven / Gradle / Ivy
package software.aws.awsprototypingsdk.nxmonorepo;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.71.0 (build f1f58ae)", date = "2022-12-07T01:30:43.728Z")
@software.amazon.jsii.Jsii(module = software.aws.awsprototypingsdk.$Module.class, fqn = "aws-prototyping-sdk.nx_monorepo.SemverGroup")
@software.amazon.jsii.Jsii.Proxy(SemverGroup.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface SemverGroup extends software.amazon.jsii.JsiiSerializable {
/**
* the names of the dependencies (eg.
*
* "lodash") which belong to this group
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.util.List getDependencies();
/**
* the names of packages in your monorepo which belong to this group, taken from the "name" field in package.json, not the package directory name.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.util.List getPackages();
/**
* the semver range which dependencies in this group should use.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getRange();
/**
* optionally only apply this group to dependencies of the provided types.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.util.List getDependencyTypes() {
return null;
}
/**
* @return a {@link Builder} of {@link SemverGroup}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link SemverGroup}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
java.util.List dependencies;
java.util.List packages;
java.lang.String range;
java.util.List dependencyTypes;
/**
* Sets the value of {@link SemverGroup#getDependencies}
* @param dependencies the names of the dependencies (eg. This parameter is required.
* "lodash") which belong to this group
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dependencies(java.util.List dependencies) {
this.dependencies = dependencies;
return this;
}
/**
* Sets the value of {@link SemverGroup#getPackages}
* @param packages the names of packages in your monorepo which belong to this group, taken from the "name" field in package.json, not the package directory name. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder packages(java.util.List packages) {
this.packages = packages;
return this;
}
/**
* Sets the value of {@link SemverGroup#getRange}
* @param range the semver range which dependencies in this group should use. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder range(java.lang.String range) {
this.range = range;
return this;
}
/**
* Sets the value of {@link SemverGroup#getDependencyTypes}
* @param dependencyTypes optionally only apply this group to dependencies of the provided types.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder dependencyTypes(java.util.List dependencyTypes) {
this.dependencyTypes = dependencyTypes;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link SemverGroup}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public SemverGroup build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link SemverGroup}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements SemverGroup {
private final java.util.List dependencies;
private final java.util.List packages;
private final java.lang.String range;
private final java.util.List dependencyTypes;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.dependencies = software.amazon.jsii.Kernel.get(this, "dependencies", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.packages = software.amazon.jsii.Kernel.get(this, "packages", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.range = software.amazon.jsii.Kernel.get(this, "range", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.dependencyTypes = software.amazon.jsii.Kernel.get(this, "dependencyTypes", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.dependencies = java.util.Objects.requireNonNull(builder.dependencies, "dependencies is required");
this.packages = java.util.Objects.requireNonNull(builder.packages, "packages is required");
this.range = java.util.Objects.requireNonNull(builder.range, "range is required");
this.dependencyTypes = builder.dependencyTypes;
}
@Override
public final java.util.List getDependencies() {
return this.dependencies;
}
@Override
public final java.util.List getPackages() {
return this.packages;
}
@Override
public final java.lang.String getRange() {
return this.range;
}
@Override
public final java.util.List getDependencyTypes() {
return this.dependencyTypes;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("dependencies", om.valueToTree(this.getDependencies()));
data.set("packages", om.valueToTree(this.getPackages()));
data.set("range", om.valueToTree(this.getRange()));
if (this.getDependencyTypes() != null) {
data.set("dependencyTypes", om.valueToTree(this.getDependencyTypes()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("aws-prototyping-sdk.nx_monorepo.SemverGroup"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SemverGroup.Jsii$Proxy that = (SemverGroup.Jsii$Proxy) o;
if (!dependencies.equals(that.dependencies)) return false;
if (!packages.equals(that.packages)) return false;
if (!range.equals(that.range)) return false;
return this.dependencyTypes != null ? this.dependencyTypes.equals(that.dependencyTypes) : that.dependencyTypes == null;
}
@Override
public final int hashCode() {
int result = this.dependencies.hashCode();
result = 31 * result + (this.packages.hashCode());
result = 31 * result + (this.range.hashCode());
result = 31 * result + (this.dependencyTypes != null ? this.dependencyTypes.hashCode() : 0);
return result;
}
}
}