io.github.cdklabs.projen.IniFileOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of projen Show documentation
Show all versions of projen Show documentation
CDK for software projects
The newest version!
package io.github.cdklabs.projen;
/**
* (experimental) Options for IniFile
.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.105.0 (build 0a2adcb)", date = "2024-11-15T17:03:54.803Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.projen.$Module.class, fqn = "projen.IniFileOptions")
@software.amazon.jsii.Jsii.Proxy(IniFileOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface IniFileOptions extends software.amazon.jsii.JsiiSerializable, io.github.cdklabs.projen.ObjectFileOptions {
/**
* @return a {@link Builder} of {@link IniFileOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link IniFileOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.Object obj;
java.lang.Boolean omitEmpty;
java.lang.Boolean committed;
java.lang.Boolean editGitignore;
java.lang.Boolean executable;
java.lang.Boolean marker;
java.lang.Boolean readonly;
/**
* Sets the value of {@link IniFileOptions#getObj}
* @param obj The object that will be serialized. You can modify the object's contents before synthesis.
* Serialization of the object is similar to JSON.stringify with few enhancements:
*
*
* - values that are functions will be called during synthesis and the result will be serialized - this allow to have lazy values.
* Set
will be converted to array
* Map
will be converted to a plain object ({ key: value, ... }})
* RegExp
without flags will be converted to string representation of the source
*
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder obj(java.lang.Object obj) {
this.obj = obj;
return this;
}
/**
* Sets the value of {@link IniFileOptions#getOmitEmpty}
* @param omitEmpty Omits empty objects and arrays.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder omitEmpty(java.lang.Boolean omitEmpty) {
this.omitEmpty = omitEmpty;
return this;
}
/**
* Sets the value of {@link IniFileOptions#getCommitted}
* @param committed Indicates whether this file should be committed to git or ignored.
* By
* default, all generated files are committed and anti-tamper is used to
* protect against manual modifications.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder committed(java.lang.Boolean committed) {
this.committed = committed;
return this;
}
/**
* Sets the value of {@link IniFileOptions#getEditGitignore}
* @param editGitignore Update the project's .gitignore file.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder editGitignore(java.lang.Boolean editGitignore) {
this.editGitignore = editGitignore;
return this;
}
/**
* Sets the value of {@link IniFileOptions#getExecutable}
* @param executable Whether the generated file should be marked as executable.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder executable(java.lang.Boolean executable) {
this.executable = executable;
return this;
}
/**
* Sets the value of {@link IniFileOptions#getMarker}
* @param marker Adds the projen marker to the file.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder marker(java.lang.Boolean marker) {
this.marker = marker;
return this;
}
/**
* Sets the value of {@link IniFileOptions#getReadonly}
* @param readonly Whether the generated file should be readonly.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder readonly(java.lang.Boolean readonly) {
this.readonly = readonly;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link IniFileOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public IniFileOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link IniFileOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements IniFileOptions {
private final java.lang.Object obj;
private final java.lang.Boolean omitEmpty;
private final java.lang.Boolean committed;
private final java.lang.Boolean editGitignore;
private final java.lang.Boolean executable;
private final java.lang.Boolean marker;
private final java.lang.Boolean readonly;
/**
* 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.obj = software.amazon.jsii.Kernel.get(this, "obj", software.amazon.jsii.NativeType.forClass(java.lang.Object.class));
this.omitEmpty = software.amazon.jsii.Kernel.get(this, "omitEmpty", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.committed = software.amazon.jsii.Kernel.get(this, "committed", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.editGitignore = software.amazon.jsii.Kernel.get(this, "editGitignore", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.executable = software.amazon.jsii.Kernel.get(this, "executable", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.marker = software.amazon.jsii.Kernel.get(this, "marker", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class));
this.readonly = software.amazon.jsii.Kernel.get(this, "readonly", 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 Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.obj = builder.obj;
this.omitEmpty = builder.omitEmpty;
this.committed = builder.committed;
this.editGitignore = builder.editGitignore;
this.executable = builder.executable;
this.marker = builder.marker;
this.readonly = builder.readonly;
}
@Override
public final java.lang.Object getObj() {
return this.obj;
}
@Override
public final java.lang.Boolean getOmitEmpty() {
return this.omitEmpty;
}
@Override
public final java.lang.Boolean getCommitted() {
return this.committed;
}
@Override
public final java.lang.Boolean getEditGitignore() {
return this.editGitignore;
}
@Override
public final java.lang.Boolean getExecutable() {
return this.executable;
}
@Override
public final java.lang.Boolean getMarker() {
return this.marker;
}
@Override
public final java.lang.Boolean getReadonly() {
return this.readonly;
}
@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.getObj() != null) {
data.set("obj", om.valueToTree(this.getObj()));
}
if (this.getOmitEmpty() != null) {
data.set("omitEmpty", om.valueToTree(this.getOmitEmpty()));
}
if (this.getCommitted() != null) {
data.set("committed", om.valueToTree(this.getCommitted()));
}
if (this.getEditGitignore() != null) {
data.set("editGitignore", om.valueToTree(this.getEditGitignore()));
}
if (this.getExecutable() != null) {
data.set("executable", om.valueToTree(this.getExecutable()));
}
if (this.getMarker() != null) {
data.set("marker", om.valueToTree(this.getMarker()));
}
if (this.getReadonly() != null) {
data.set("readonly", om.valueToTree(this.getReadonly()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("projen.IniFileOptions"));
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;
IniFileOptions.Jsii$Proxy that = (IniFileOptions.Jsii$Proxy) o;
if (this.obj != null ? !this.obj.equals(that.obj) : that.obj != null) return false;
if (this.omitEmpty != null ? !this.omitEmpty.equals(that.omitEmpty) : that.omitEmpty != null) return false;
if (this.committed != null ? !this.committed.equals(that.committed) : that.committed != null) return false;
if (this.editGitignore != null ? !this.editGitignore.equals(that.editGitignore) : that.editGitignore != null) return false;
if (this.executable != null ? !this.executable.equals(that.executable) : that.executable != null) return false;
if (this.marker != null ? !this.marker.equals(that.marker) : that.marker != null) return false;
return this.readonly != null ? this.readonly.equals(that.readonly) : that.readonly == null;
}
@Override
public final int hashCode() {
int result = this.obj != null ? this.obj.hashCode() : 0;
result = 31 * result + (this.omitEmpty != null ? this.omitEmpty.hashCode() : 0);
result = 31 * result + (this.committed != null ? this.committed.hashCode() : 0);
result = 31 * result + (this.editGitignore != null ? this.editGitignore.hashCode() : 0);
result = 31 * result + (this.executable != null ? this.executable.hashCode() : 0);
result = 31 * result + (this.marker != null ? this.marker.hashCode() : 0);
result = 31 * result + (this.readonly != null ? this.readonly.hashCode() : 0);
return result;
}
}
}