/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.amplifyuibuilder.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Contains the configuration settings for a Form
user interface (UI) element for an Amplify app. A form is
* a component you can add to your project by specifying a data source as the default configuration for the form.
*
* The unique ID of the Amplify app associated with the form. *
*/ private String appId; /** ** The name of the backend environment that is a part of the Amplify app. *
*/ private String environmentName; /** ** The unique ID of the form. *
*/ private String id; /** ** The name of the form. *
*/ private String name; /** ** The operation to perform on the specified form. *
*/ private String formActionType; /** ** Stores the configuration for the form's style. *
*/ private FormStyle style; /** ** The type of data source to use to create the form. *
*/ private FormDataTypeConfig dataType; /** ** Stores the information about the form's fields. *
*/ private java.util.Map* Stores the visual helper elements for the form that are not associated with any data. *
*/ private java.util.Map* The schema version of the form when it was imported. *
*/ private String schemaVersion; /** ** One or more key-value pairs to use when tagging the form. *
*/ private java.util.Map* Stores the call to action configuration for the form. *
*/ private FormCTA cta; /** ** Specifies an icon or decoration to display on the form. *
*/ private String labelDecorator; /** ** The unique ID of the Amplify app associated with the form. *
* * @param appId * The unique ID of the Amplify app associated with the form. */ public void setAppId(String appId) { this.appId = appId; } /** ** The unique ID of the Amplify app associated with the form. *
* * @return The unique ID of the Amplify app associated with the form. */ public String getAppId() { return this.appId; } /** ** The unique ID of the Amplify app associated with the form. *
* * @param appId * The unique ID of the Amplify app associated with the form. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withAppId(String appId) { setAppId(appId); return this; } /** ** The name of the backend environment that is a part of the Amplify app. *
* * @param environmentName * The name of the backend environment that is a part of the Amplify app. */ public void setEnvironmentName(String environmentName) { this.environmentName = environmentName; } /** ** The name of the backend environment that is a part of the Amplify app. *
* * @return The name of the backend environment that is a part of the Amplify app. */ public String getEnvironmentName() { return this.environmentName; } /** ** The name of the backend environment that is a part of the Amplify app. *
* * @param environmentName * The name of the backend environment that is a part of the Amplify app. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withEnvironmentName(String environmentName) { setEnvironmentName(environmentName); return this; } /** ** The unique ID of the form. *
* * @param id * The unique ID of the form. */ public void setId(String id) { this.id = id; } /** ** The unique ID of the form. *
* * @return The unique ID of the form. */ public String getId() { return this.id; } /** ** The unique ID of the form. *
* * @param id * The unique ID of the form. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withId(String id) { setId(id); return this; } /** ** The name of the form. *
* * @param name * The name of the form. */ public void setName(String name) { this.name = name; } /** ** The name of the form. *
* * @return The name of the form. */ public String getName() { return this.name; } /** ** The name of the form. *
* * @param name * The name of the form. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withName(String name) { setName(name); return this; } /** ** The operation to perform on the specified form. *
* * @param formActionType * The operation to perform on the specified form. * @see FormActionType */ public void setFormActionType(String formActionType) { this.formActionType = formActionType; } /** ** The operation to perform on the specified form. *
* * @return The operation to perform on the specified form. * @see FormActionType */ public String getFormActionType() { return this.formActionType; } /** ** The operation to perform on the specified form. *
* * @param formActionType * The operation to perform on the specified form. * @return Returns a reference to this object so that method calls can be chained together. * @see FormActionType */ public Form withFormActionType(String formActionType) { setFormActionType(formActionType); return this; } /** ** The operation to perform on the specified form. *
* * @param formActionType * The operation to perform on the specified form. * @return Returns a reference to this object so that method calls can be chained together. * @see FormActionType */ public Form withFormActionType(FormActionType formActionType) { this.formActionType = formActionType.toString(); return this; } /** ** Stores the configuration for the form's style. *
* * @param style * Stores the configuration for the form's style. */ public void setStyle(FormStyle style) { this.style = style; } /** ** Stores the configuration for the form's style. *
* * @return Stores the configuration for the form's style. */ public FormStyle getStyle() { return this.style; } /** ** Stores the configuration for the form's style. *
* * @param style * Stores the configuration for the form's style. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withStyle(FormStyle style) { setStyle(style); return this; } /** ** The type of data source to use to create the form. *
* * @param dataType * The type of data source to use to create the form. */ public void setDataType(FormDataTypeConfig dataType) { this.dataType = dataType; } /** ** The type of data source to use to create the form. *
* * @return The type of data source to use to create the form. */ public FormDataTypeConfig getDataType() { return this.dataType; } /** ** The type of data source to use to create the form. *
* * @param dataType * The type of data source to use to create the form. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withDataType(FormDataTypeConfig dataType) { setDataType(dataType); return this; } /** ** Stores the information about the form's fields. *
* * @return Stores the information about the form's fields. */ public java.util.Map* Stores the information about the form's fields. *
* * @param fields * Stores the information about the form's fields. */ public void setFields(java.util.Map* Stores the information about the form's fields. *
* * @param fields * Stores the information about the form's fields. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withFields(java.util.Map* Stores the visual helper elements for the form that are not associated with any data. *
* * @return Stores the visual helper elements for the form that are not associated with any data. */ public java.util.Map* Stores the visual helper elements for the form that are not associated with any data. *
* * @param sectionalElements * Stores the visual helper elements for the form that are not associated with any data. */ public void setSectionalElements(java.util.Map* Stores the visual helper elements for the form that are not associated with any data. *
* * @param sectionalElements * Stores the visual helper elements for the form that are not associated with any data. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withSectionalElements(java.util.Map* The schema version of the form when it was imported. *
* * @param schemaVersion * The schema version of the form when it was imported. */ public void setSchemaVersion(String schemaVersion) { this.schemaVersion = schemaVersion; } /** ** The schema version of the form when it was imported. *
* * @return The schema version of the form when it was imported. */ public String getSchemaVersion() { return this.schemaVersion; } /** ** The schema version of the form when it was imported. *
* * @param schemaVersion * The schema version of the form when it was imported. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withSchemaVersion(String schemaVersion) { setSchemaVersion(schemaVersion); return this; } /** ** One or more key-value pairs to use when tagging the form. *
* * @return One or more key-value pairs to use when tagging the form. */ public java.util.Map* One or more key-value pairs to use when tagging the form. *
* * @param tags * One or more key-value pairs to use when tagging the form. */ public void setTags(java.util.Map* One or more key-value pairs to use when tagging the form. *
* * @param tags * One or more key-value pairs to use when tagging the form. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withTags(java.util.Map* Stores the call to action configuration for the form. *
* * @param cta * Stores the call to action configuration for the form. */ public void setCta(FormCTA cta) { this.cta = cta; } /** ** Stores the call to action configuration for the form. *
* * @return Stores the call to action configuration for the form. */ public FormCTA getCta() { return this.cta; } /** ** Stores the call to action configuration for the form. *
* * @param cta * Stores the call to action configuration for the form. * @return Returns a reference to this object so that method calls can be chained together. */ public Form withCta(FormCTA cta) { setCta(cta); return this; } /** ** Specifies an icon or decoration to display on the form. *
* * @param labelDecorator * Specifies an icon or decoration to display on the form. * @see LabelDecorator */ public void setLabelDecorator(String labelDecorator) { this.labelDecorator = labelDecorator; } /** ** Specifies an icon or decoration to display on the form. *
* * @return Specifies an icon or decoration to display on the form. * @see LabelDecorator */ public String getLabelDecorator() { return this.labelDecorator; } /** ** Specifies an icon or decoration to display on the form. *
* * @param labelDecorator * Specifies an icon or decoration to display on the form. * @return Returns a reference to this object so that method calls can be chained together. * @see LabelDecorator */ public Form withLabelDecorator(String labelDecorator) { setLabelDecorator(labelDecorator); return this; } /** ** Specifies an icon or decoration to display on the form. *
* * @param labelDecorator * Specifies an icon or decoration to display on the form. * @return Returns a reference to this object so that method calls can be chained together. * @see LabelDecorator */ public Form withLabelDecorator(LabelDecorator labelDecorator) { this.labelDecorator = labelDecorator.toString(); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAppId() != null) sb.append("AppId: ").append(getAppId()).append(","); if (getEnvironmentName() != null) sb.append("EnvironmentName: ").append(getEnvironmentName()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getFormActionType() != null) sb.append("FormActionType: ").append(getFormActionType()).append(","); if (getStyle() != null) sb.append("Style: ").append(getStyle()).append(","); if (getDataType() != null) sb.append("DataType: ").append(getDataType()).append(","); if (getFields() != null) sb.append("Fields: ").append(getFields()).append(","); if (getSectionalElements() != null) sb.append("SectionalElements: ").append(getSectionalElements()).append(","); if (getSchemaVersion() != null) sb.append("SchemaVersion: ").append(getSchemaVersion()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getCta() != null) sb.append("Cta: ").append(getCta()).append(","); if (getLabelDecorator() != null) sb.append("LabelDecorator: ").append(getLabelDecorator()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Form == false) return false; Form other = (Form) obj; if (other.getAppId() == null ^ this.getAppId() == null) return false; if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == false) return false; if (other.getEnvironmentName() == null ^ this.getEnvironmentName() == null) return false; if (other.getEnvironmentName() != null && other.getEnvironmentName().equals(this.getEnvironmentName()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getFormActionType() == null ^ this.getFormActionType() == null) return false; if (other.getFormActionType() != null && other.getFormActionType().equals(this.getFormActionType()) == false) return false; if (other.getStyle() == null ^ this.getStyle() == null) return false; if (other.getStyle() != null && other.getStyle().equals(this.getStyle()) == false) return false; if (other.getDataType() == null ^ this.getDataType() == null) return false; if (other.getDataType() != null && other.getDataType().equals(this.getDataType()) == false) return false; if (other.getFields() == null ^ this.getFields() == null) return false; if (other.getFields() != null && other.getFields().equals(this.getFields()) == false) return false; if (other.getSectionalElements() == null ^ this.getSectionalElements() == null) return false; if (other.getSectionalElements() != null && other.getSectionalElements().equals(this.getSectionalElements()) == false) return false; if (other.getSchemaVersion() == null ^ this.getSchemaVersion() == null) return false; if (other.getSchemaVersion() != null && other.getSchemaVersion().equals(this.getSchemaVersion()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getCta() == null ^ this.getCta() == null) return false; if (other.getCta() != null && other.getCta().equals(this.getCta()) == false) return false; if (other.getLabelDecorator() == null ^ this.getLabelDecorator() == null) return false; if (other.getLabelDecorator() != null && other.getLabelDecorator().equals(this.getLabelDecorator()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAppId() == null) ? 0 : getAppId().hashCode()); hashCode = prime * hashCode + ((getEnvironmentName() == null) ? 0 : getEnvironmentName().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getFormActionType() == null) ? 0 : getFormActionType().hashCode()); hashCode = prime * hashCode + ((getStyle() == null) ? 0 : getStyle().hashCode()); hashCode = prime * hashCode + ((getDataType() == null) ? 0 : getDataType().hashCode()); hashCode = prime * hashCode + ((getFields() == null) ? 0 : getFields().hashCode()); hashCode = prime * hashCode + ((getSectionalElements() == null) ? 0 : getSectionalElements().hashCode()); hashCode = prime * hashCode + ((getSchemaVersion() == null) ? 0 : getSchemaVersion().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getCta() == null) ? 0 : getCta().hashCode()); hashCode = prime * hashCode + ((getLabelDecorator() == null) ? 0 : getLabelDecorator().hashCode()); return hashCode; } @Override public Form clone() { try { return (Form) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.amplifyuibuilder.model.transform.FormMarshaller.getInstance().marshall(this, protocolMarshaller); } }