io.github.cdklabs.awscdk.appsync.utils.AddFieldOptions Maven / Gradle / Ivy
Show all versions of awscdk-appsync-utils Show documentation
package io.github.cdklabs.awscdk.appsync.utils;
/**
* The options to add a field to an Intermediate Type.
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-09-28T00:18:00.278Z")
@software.amazon.jsii.Jsii(module = io.github.cdklabs.awscdk.appsync.utils.$Module.class, fqn = "awscdk-appsync-utils.AddFieldOptions")
@software.amazon.jsii.Jsii.Proxy(AddFieldOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface AddFieldOptions extends software.amazon.jsii.JsiiSerializable {
/**
* The resolvable field to add.
*
* This option must be configured for Object, Interface,
* Input and Union Types.
*
* Default: - no IField
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable io.github.cdklabs.awscdk.appsync.utils.IField getField() {
return null;
}
/**
* The name of the field.
*
* This option must be configured for Object, Interface,
* Input and Enum Types.
*
* Default: - no fieldName
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getFieldName() {
return null;
}
/**
* @return a {@link Builder} of {@link AddFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link AddFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
io.github.cdklabs.awscdk.appsync.utils.IField field;
java.lang.String fieldName;
/**
* Sets the value of {@link AddFieldOptions#getField}
* @param field The resolvable field to add.
* This option must be configured for Object, Interface,
* Input and Union Types.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder field(io.github.cdklabs.awscdk.appsync.utils.IField field) {
this.field = field;
return this;
}
/**
* Sets the value of {@link AddFieldOptions#getFieldName}
* @param fieldName The name of the field.
* This option must be configured for Object, Interface,
* Input and Enum Types.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder fieldName(java.lang.String fieldName) {
this.fieldName = fieldName;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link AddFieldOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public AddFieldOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link AddFieldOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements AddFieldOptions {
private final io.github.cdklabs.awscdk.appsync.utils.IField field;
private final java.lang.String fieldName;
/**
* 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.field = software.amazon.jsii.Kernel.get(this, "field", software.amazon.jsii.NativeType.forClass(io.github.cdklabs.awscdk.appsync.utils.IField.class));
this.fieldName = software.amazon.jsii.Kernel.get(this, "fieldName", 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.field = builder.field;
this.fieldName = builder.fieldName;
}
@Override
public final io.github.cdklabs.awscdk.appsync.utils.IField getField() {
return this.field;
}
@Override
public final java.lang.String getFieldName() {
return this.fieldName;
}
@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.getField() != null) {
data.set("field", om.valueToTree(this.getField()));
}
if (this.getFieldName() != null) {
data.set("fieldName", om.valueToTree(this.getFieldName()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("awscdk-appsync-utils.AddFieldOptions"));
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;
AddFieldOptions.Jsii$Proxy that = (AddFieldOptions.Jsii$Proxy) o;
if (this.field != null ? !this.field.equals(that.field) : that.field != null) return false;
return this.fieldName != null ? this.fieldName.equals(that.fieldName) : that.fieldName == null;
}
@Override
public final int hashCode() {
int result = this.field != null ? this.field.hashCode() : 0;
result = 31 * result + (this.fieldName != null ? this.fieldName.hashCode() : 0);
return result;
}
}
}