io.github.cdklabs.projen.java.MavenRepositoryPolicy Maven / Gradle / Ivy
Show all versions of projen Show documentation
package io.github.cdklabs.projen.java;
/**
* (experimental) Represents a Maven Repository Policy.
*
* @see https://maven.apache.org/settings.html#repositories
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T17:03:55.268Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.java.MavenRepositoryPolicy")
@software.amazon.jsii.Jsii.Proxy(MavenRepositoryPolicy.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface MavenRepositoryPolicy extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Checksum Policy When Maven deploys files to the repository, it also deploys corresponding checksum files.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.java.ChecksumPolicy getChecksumPolicy() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getEnabled() {
return null;
}
/**
* (experimental) Update Policy This element specifies how often updates should attempt to occur.
*
* Maven will compare the local POM's timestamp (stored in a repository's maven-metadata file) to the remote.
*
* Default: UpdatePolicy.DAILY
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.projen.java.UpdatePolicy getUpdatePolicy() {
return null;
}
/**
* @return a {@link Builder} of {@link MavenRepositoryPolicy}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link MavenRepositoryPolicy}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.projen.java.ChecksumPolicy checksumPolicy;
java.lang.Boolean enabled;
io.github.cdklabs.projen.java.UpdatePolicy updatePolicy;
/**
* Sets the value of {@link MavenRepositoryPolicy#getChecksumPolicy}
* @param checksumPolicy Checksum Policy When Maven deploys files to the repository, it also deploys corresponding checksum files.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder checksumPolicy(io.github.cdklabs.projen.java.ChecksumPolicy checksumPolicy) {
this.checksumPolicy = checksumPolicy;
return this;
}
/**
* Sets the value of {@link MavenRepositoryPolicy#getEnabled}
* @param enabled the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder enabled(java.lang.Boolean enabled) {
this.enabled = enabled;
return this;
}
/**
* Sets the value of {@link MavenRepositoryPolicy#getUpdatePolicy}
* @param updatePolicy Update Policy This element specifies how often updates should attempt to occur.
* Maven will compare the local POM's timestamp (stored in a repository's maven-metadata file) to the remote.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder updatePolicy(io.github.cdklabs.projen.java.UpdatePolicy updatePolicy) {
this.updatePolicy = updatePolicy;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link MavenRepositoryPolicy}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public MavenRepositoryPolicy build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link MavenRepositoryPolicy}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements MavenRepositoryPolicy {
private final io.github.cdklabs.projen.java.ChecksumPolicy checksumPolicy;
private final java.lang.Boolean enabled;
private final io.github.cdklabs.projen.java.UpdatePolicy updatePolicy;
/**
* 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.checksumPolicy = software.amazon.jsii.Kernel.get(this, "checksumPolicy", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.java.ChecksumPolicy.class));
this.enabled = software.amazon.jsii.Kernel.get(this, "enabled", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.updatePolicy = software.amazon.jsii.Kernel.get(this, "updatePolicy", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.projen.java.UpdatePolicy.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.checksumPolicy = builder.checksumPolicy;
this.enabled = builder.enabled;
this.updatePolicy = builder.updatePolicy;
}
@Override
public final io.github.cdklabs.projen.java.ChecksumPolicy getChecksumPolicy() {
return this.checksumPolicy;
}
@Override
public final java.lang.Boolean getEnabled() {
return this.enabled;
}
@Override
public final io.github.cdklabs.projen.java.UpdatePolicy getUpdatePolicy() {
return this.updatePolicy;
}
@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();
if (this.getChecksumPolicy() != null) {
data.set("checksumPolicy", om.valueToTree(this.getChecksumPolicy()));
}
if (this.getEnabled() != null) {
data.set("enabled", om.valueToTree(this.getEnabled()));
}
if (this.getUpdatePolicy() != null) {
data.set("updatePolicy", om.valueToTree(this.getUpdatePolicy()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.java.MavenRepositoryPolicy"));
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;
MavenRepositoryPolicy.Jsii$Proxy that = (MavenRepositoryPolicy.Jsii$Proxy) o;
if (this.checksumPolicy != null ? !this.checksumPolicy.equals(that.checksumPolicy) : that.checksumPolicy != null) return false;
if (this.enabled != null ? !this.enabled.equals(that.enabled) : that.enabled != null) return false;
return this.updatePolicy != null ? this.updatePolicy.equals(that.updatePolicy) : that.updatePolicy == null;
}
@Override
public final int hashCode() {
int result = this.checksumPolicy != null ? this.checksumPolicy.hashCode() : 0;
result = 31 * result + (this.enabled != null ? this.enabled.hashCode() : 0);
result = 31 * result + (this.updatePolicy != null ? this.updatePolicy.hashCode() : 0);
return result;
}
}
}