org.projen.github.StaleBehavior Maven / Gradle / Ivy
Show all versions of projen Show documentation
package org.projen.github;
/**
* (experimental) Stale behavior.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.34.0 (build 9b72778)", date = "2021-09-05T18:03:09.277Z")
@software.amazon.jsii.Jsii(module = org.projen.$Module.class, fqn = "projen.github.StaleBehavior")
@software.amazon.jsii.Jsii.Proxy(StaleBehavior.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface StaleBehavior extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The comment to add to the issue/PR when it's closed.
*
* Default: "Closing this pull request as it hasn\'t seen activity for a while. Please add a comment
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getCloseMessage() {
return null;
}
/**
* (experimental) Days until the issue/PR is closed after it is marked as "Stale".
*
* Set to -1 to disable.
*
* Default: -
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getDaysBeforeClose() {
return null;
}
/**
* (experimental) How many days until the issue or pull request is marked as "Stale".
*
* Set to -1 to disable.
*
* Default: -
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Number getDaysBeforeStale() {
return null;
}
/**
* (experimental) Determines if this behavior is enabled.
*
* Same as setting daysBeforeStale
and daysBeforeClose
to -1
.
*
* Default: true
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.Boolean getEnabled() {
return null;
}
/**
* (experimental) The label to apply to the issue/PR when it becomes stale.
*
* Default: "Stale"
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getStaleLabel() {
return null;
}
/**
* (experimental) The comment to add to the issue/PR when it becomes stale.
*
* Default: "This pull request is now marked as stale because hasn\'t seen activity for a while. Add a comment or it will be closed soon."
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getStaleMessage() {
return null;
}
/**
* @return a {@link Builder} of {@link StaleBehavior}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link StaleBehavior}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.String closeMessage;
private java.lang.Number daysBeforeClose;
private java.lang.Number daysBeforeStale;
private java.lang.Boolean enabled;
private java.lang.String staleLabel;
private java.lang.String staleMessage;
/**
* Sets the value of {@link StaleBehavior#getCloseMessage}
* @param closeMessage The comment to add to the issue/PR when it's closed.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder closeMessage(java.lang.String closeMessage) {
this.closeMessage = closeMessage;
return this;
}
/**
* Sets the value of {@link StaleBehavior#getDaysBeforeClose}
* @param daysBeforeClose Days until the issue/PR is closed after it is marked as "Stale".
* Set to -1 to disable.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder daysBeforeClose(java.lang.Number daysBeforeClose) {
this.daysBeforeClose = daysBeforeClose;
return this;
}
/**
* Sets the value of {@link StaleBehavior#getDaysBeforeStale}
* @param daysBeforeStale How many days until the issue or pull request is marked as "Stale".
* Set to -1 to disable.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder daysBeforeStale(java.lang.Number daysBeforeStale) {
this.daysBeforeStale = daysBeforeStale;
return this;
}
/**
* Sets the value of {@link StaleBehavior#getEnabled}
* @param enabled Determines if this behavior is enabled.
* Same as setting daysBeforeStale
and daysBeforeClose
to -1
.
* @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 StaleBehavior#getStaleLabel}
* @param staleLabel The label to apply to the issue/PR when it becomes stale.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder staleLabel(java.lang.String staleLabel) {
this.staleLabel = staleLabel;
return this;
}
/**
* Sets the value of {@link StaleBehavior#getStaleMessage}
* @param staleMessage The comment to add to the issue/PR when it becomes stale.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder staleMessage(java.lang.String staleMessage) {
this.staleMessage = staleMessage;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link StaleBehavior}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public StaleBehavior build() {
return new Jsii$Proxy(closeMessage, daysBeforeClose, daysBeforeStale, enabled, staleLabel, staleMessage);
}
}
/**
* An implementation for {@link StaleBehavior}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements StaleBehavior {
private final java.lang.String closeMessage;
private final java.lang.Number daysBeforeClose;
private final java.lang.Number daysBeforeStale;
private final java.lang.Boolean enabled;
private final java.lang.String staleLabel;
private final java.lang.String staleMessage;
/**
* 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.closeMessage = software.amazon.jsii.Kernel.get(this, "closeMessage", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.daysBeforeClose = software.amazon.jsii.Kernel.get(this, "daysBeforeClose", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.daysBeforeStale = software.amazon.jsii.Kernel.get(this, "daysBeforeStale", software.amazon.jsii.NativeType.forClass(java.lang.Number.class));
this.enabled = software.amazon.jsii.Kernel.get(this, "enabled", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.staleLabel = software.amazon.jsii.Kernel.get(this, "staleLabel", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.staleMessage = software.amazon.jsii.Kernel.get(this, "staleMessage", 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 java.lang.String closeMessage, final java.lang.Number daysBeforeClose, final java.lang.Number daysBeforeStale, final java.lang.Boolean enabled, final java.lang.String staleLabel, final java.lang.String staleMessage) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.closeMessage = closeMessage;
this.daysBeforeClose = daysBeforeClose;
this.daysBeforeStale = daysBeforeStale;
this.enabled = enabled;
this.staleLabel = staleLabel;
this.staleMessage = staleMessage;
}
@Override
public final java.lang.String getCloseMessage() {
return this.closeMessage;
}
@Override
public final java.lang.Number getDaysBeforeClose() {
return this.daysBeforeClose;
}
@Override
public final java.lang.Number getDaysBeforeStale() {
return this.daysBeforeStale;
}
@Override
public final java.lang.Boolean getEnabled() {
return this.enabled;
}
@Override
public final java.lang.String getStaleLabel() {
return this.staleLabel;
}
@Override
public final java.lang.String getStaleMessage() {
return this.staleMessage;
}
@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.getCloseMessage() != null) {
data.set("closeMessage", om.valueToTree(this.getCloseMessage()));
}
if (this.getDaysBeforeClose() != null) {
data.set("daysBeforeClose", om.valueToTree(this.getDaysBeforeClose()));
}
if (this.getDaysBeforeStale() != null) {
data.set("daysBeforeStale", om.valueToTree(this.getDaysBeforeStale()));
}
if (this.getEnabled() != null) {
data.set("enabled", om.valueToTree(this.getEnabled()));
}
if (this.getStaleLabel() != null) {
data.set("staleLabel", om.valueToTree(this.getStaleLabel()));
}
if (this.getStaleMessage() != null) {
data.set("staleMessage", om.valueToTree(this.getStaleMessage()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.github.StaleBehavior"));
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;
StaleBehavior.Jsii$Proxy that = (StaleBehavior.Jsii$Proxy) o;
if (this.closeMessage != null ? !this.closeMessage.equals(that.closeMessage) : that.closeMessage != null) return false;
if (this.daysBeforeClose != null ? !this.daysBeforeClose.equals(that.daysBeforeClose) : that.daysBeforeClose != null) return false;
if (this.daysBeforeStale != null ? !this.daysBeforeStale.equals(that.daysBeforeStale) : that.daysBeforeStale != null) return false;
if (this.enabled != null ? !this.enabled.equals(that.enabled) : that.enabled != null) return false;
if (this.staleLabel != null ? !this.staleLabel.equals(that.staleLabel) : that.staleLabel != null) return false;
return this.staleMessage != null ? this.staleMessage.equals(that.staleMessage) : that.staleMessage == null;
}
@Override
public final int hashCode() {
int result = this.closeMessage != null ? this.closeMessage.hashCode() : 0;
result = 31 * result + (this.daysBeforeClose != null ? this.daysBeforeClose.hashCode() : 0);
result = 31 * result + (this.daysBeforeStale != null ? this.daysBeforeStale.hashCode() : 0);
result = 31 * result + (this.enabled != null ? this.enabled.hashCode() : 0);
result = 31 * result + (this.staleLabel != null ? this.staleLabel.hashCode() : 0);
result = 31 * result + (this.staleMessage != null ? this.staleMessage.hashCode() : 0);
return result;
}
}
}