org.projen.github.GitHubOptions Maven / Gradle / Ivy
Show all versions of projen Show documentation
package org.projen.github;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.34.0 (build 9b72778)", date = "2021-09-05T18:03:09.274Z")
@software.amazon.jsii.Jsii(module = org.projen.$Module.class, fqn = "projen.github.GitHubOptions")
@software.amazon.jsii.Jsii.Proxy(GitHubOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface GitHubOptions extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) Whether mergify should be enabled on this repository or not.
*
* Default: true
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getMergify() {
return null;
}
/**
* (experimental) Enables GitHub workflows.
*
* If this is set to false
, workflows will not be created.
*
* Default: true
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getWorkflows() {
return null;
}
/**
* @return a {@link Builder} of {@link GitHubOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link GitHubOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.Boolean mergify;
private java.lang.Boolean workflows;
/**
* Sets the value of {@link GitHubOptions#getMergify}
* @param mergify Whether mergify should be enabled on this repository or not.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder mergify(java.lang.Boolean mergify) {
this.mergify = mergify;
return this;
}
/**
* Sets the value of {@link GitHubOptions#getWorkflows}
* @param workflows Enables GitHub workflows.
* If this is set to false
, workflows will not be created.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder workflows(java.lang.Boolean workflows) {
this.workflows = workflows;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link GitHubOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public GitHubOptions build() {
return new Jsii$Proxy(mergify, workflows);
}
}
/**
* An implementation for {@link GitHubOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements GitHubOptions {
private final java.lang.Boolean mergify;
private final java.lang.Boolean workflows;
/**
* 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.mergify = software.amazon.jsii.Kernel.get(this, "mergify", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.workflows = software.amazon.jsii.Kernel.get(this, "workflows", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final java.lang.Boolean mergify, final java.lang.Boolean workflows) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.mergify = mergify;
this.workflows = workflows;
}
@Override
public final java.lang.Boolean getMergify() {
return this.mergify;
}
@Override
public final java.lang.Boolean getWorkflows() {
return this.workflows;
}
@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.getMergify() != null) {
data.set("mergify", om.valueToTree(this.getMergify()));
}
if (this.getWorkflows() != null) {
data.set("workflows", om.valueToTree(this.getWorkflows()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.github.GitHubOptions"));
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;
GitHubOptions.Jsii$Proxy that = (GitHubOptions.Jsii$Proxy) o;
if (this.mergify != null ? !this.mergify.equals(that.mergify) : that.mergify != null) return false;
return this.workflows != null ? this.workflows.equals(that.workflows) : that.workflows == null;
}
@Override
public final int hashCode() {
int result = this.mergify != null ? this.mergify.hashCode() : 0;
result = 31 * result + (this.workflows != null ? this.workflows.hashCode() : 0);
return result;
}
}
}