/* * 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.glue.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetPlanRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *

* The list of mappings from a source table to target tables. *

*/ private java.util.List mapping; /** *

* The source table. *

*/ private CatalogEntry source; /** *

* The target tables. *

*/ private java.util.List sinks; /** *

* The parameters for the mapping. *

*/ private Location location; /** *

* The programming language of the code to perform the mapping. *

*/ private String language; /** *

* A map to hold additional optional key-value parameters. *

*

* Currently, these key-value pairs are supported: *

* */ private java.util.Map additionalPlanOptionsMap; /** *

* The list of mappings from a source table to target tables. *

* * @return The list of mappings from a source table to target tables. */ public java.util.List getMapping() { return mapping; } /** *

* The list of mappings from a source table to target tables. *

* * @param mapping * The list of mappings from a source table to target tables. */ public void setMapping(java.util.Collection mapping) { if (mapping == null) { this.mapping = null; return; } this.mapping = new java.util.ArrayList(mapping); } /** *

* The list of mappings from a source table to target tables. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setMapping(java.util.Collection)} or {@link #withMapping(java.util.Collection)} if you want to override * the existing values. *

* * @param mapping * The list of mappings from a source table to target tables. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest withMapping(MappingEntry... mapping) { if (this.mapping == null) { setMapping(new java.util.ArrayList(mapping.length)); } for (MappingEntry ele : mapping) { this.mapping.add(ele); } return this; } /** *

* The list of mappings from a source table to target tables. *

* * @param mapping * The list of mappings from a source table to target tables. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest withMapping(java.util.Collection mapping) { setMapping(mapping); return this; } /** *

* The source table. *

* * @param source * The source table. */ public void setSource(CatalogEntry source) { this.source = source; } /** *

* The source table. *

* * @return The source table. */ public CatalogEntry getSource() { return this.source; } /** *

* The source table. *

* * @param source * The source table. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest withSource(CatalogEntry source) { setSource(source); return this; } /** *

* The target tables. *

* * @return The target tables. */ public java.util.List getSinks() { return sinks; } /** *

* The target tables. *

* * @param sinks * The target tables. */ public void setSinks(java.util.Collection sinks) { if (sinks == null) { this.sinks = null; return; } this.sinks = new java.util.ArrayList(sinks); } /** *

* The target tables. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSinks(java.util.Collection)} or {@link #withSinks(java.util.Collection)} if you want to override the * existing values. *

* * @param sinks * The target tables. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest withSinks(CatalogEntry... sinks) { if (this.sinks == null) { setSinks(new java.util.ArrayList(sinks.length)); } for (CatalogEntry ele : sinks) { this.sinks.add(ele); } return this; } /** *

* The target tables. *

* * @param sinks * The target tables. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest withSinks(java.util.Collection sinks) { setSinks(sinks); return this; } /** *

* The parameters for the mapping. *

* * @param location * The parameters for the mapping. */ public void setLocation(Location location) { this.location = location; } /** *

* The parameters for the mapping. *

* * @return The parameters for the mapping. */ public Location getLocation() { return this.location; } /** *

* The parameters for the mapping. *

* * @param location * The parameters for the mapping. * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest withLocation(Location location) { setLocation(location); return this; } /** *

* The programming language of the code to perform the mapping. *

* * @param language * The programming language of the code to perform the mapping. * @see Language */ public void setLanguage(String language) { this.language = language; } /** *

* The programming language of the code to perform the mapping. *

* * @return The programming language of the code to perform the mapping. * @see Language */ public String getLanguage() { return this.language; } /** *

* The programming language of the code to perform the mapping. *

* * @param language * The programming language of the code to perform the mapping. * @return Returns a reference to this object so that method calls can be chained together. * @see Language */ public GetPlanRequest withLanguage(String language) { setLanguage(language); return this; } /** *

* The programming language of the code to perform the mapping. *

* * @param language * The programming language of the code to perform the mapping. * @return Returns a reference to this object so that method calls can be chained together. * @see Language */ public GetPlanRequest withLanguage(Language language) { this.language = language.toString(); return this; } /** *

* A map to hold additional optional key-value parameters. *

*

* Currently, these key-value pairs are supported: *

*
    *
  • *

    * inferSchema  —  Specifies whether to set inferSchema to true or false for the default * script generated by an Glue job. For example, to set inferSchema to true, pass the following key * value pair: *

    *

    * --additional-plan-options-map '{"inferSchema":"true"}' *

    *
  • *
* * @return A map to hold additional optional key-value parameters.

*

* Currently, these key-value pairs are supported: *

*
    *
  • *

    * inferSchema  —  Specifies whether to set inferSchema to true or false for the * default script generated by an Glue job. For example, to set inferSchema to true, pass the * following key value pair: *

    *

    * --additional-plan-options-map '{"inferSchema":"true"}' *

    *
  • */ public java.util.Map getAdditionalPlanOptionsMap() { return additionalPlanOptionsMap; } /** *

    * A map to hold additional optional key-value parameters. *

    *

    * Currently, these key-value pairs are supported: *

    *
      *
    • *

      * inferSchema  —  Specifies whether to set inferSchema to true or false for the default * script generated by an Glue job. For example, to set inferSchema to true, pass the following key * value pair: *

      *

      * --additional-plan-options-map '{"inferSchema":"true"}' *

      *
    • *
    * * @param additionalPlanOptionsMap * A map to hold additional optional key-value parameters.

    *

    * Currently, these key-value pairs are supported: *

    *
      *
    • *

      * inferSchema  —  Specifies whether to set inferSchema to true or false for the * default script generated by an Glue job. For example, to set inferSchema to true, pass the * following key value pair: *

      *

      * --additional-plan-options-map '{"inferSchema":"true"}' *

      *
    • */ public void setAdditionalPlanOptionsMap(java.util.Map additionalPlanOptionsMap) { this.additionalPlanOptionsMap = additionalPlanOptionsMap; } /** *

      * A map to hold additional optional key-value parameters. *

      *

      * Currently, these key-value pairs are supported: *

      *
        *
      • *

        * inferSchema  —  Specifies whether to set inferSchema to true or false for the default * script generated by an Glue job. For example, to set inferSchema to true, pass the following key * value pair: *

        *

        * --additional-plan-options-map '{"inferSchema":"true"}' *

        *
      • *
      * * @param additionalPlanOptionsMap * A map to hold additional optional key-value parameters.

      *

      * Currently, these key-value pairs are supported: *

      *
        *
      • *

        * inferSchema  —  Specifies whether to set inferSchema to true or false for the * default script generated by an Glue job. For example, to set inferSchema to true, pass the * following key value pair: *

        *

        * --additional-plan-options-map '{"inferSchema":"true"}' *

        *
      • * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest withAdditionalPlanOptionsMap(java.util.Map additionalPlanOptionsMap) { setAdditionalPlanOptionsMap(additionalPlanOptionsMap); return this; } /** * Add a single AdditionalPlanOptionsMap entry * * @see GetPlanRequest#withAdditionalPlanOptionsMap * @returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest addAdditionalPlanOptionsMapEntry(String key, String value) { if (null == this.additionalPlanOptionsMap) { this.additionalPlanOptionsMap = new java.util.HashMap(); } if (this.additionalPlanOptionsMap.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.additionalPlanOptionsMap.put(key, value); return this; } /** * Removes all the entries added into AdditionalPlanOptionsMap. * * @return Returns a reference to this object so that method calls can be chained together. */ public GetPlanRequest clearAdditionalPlanOptionsMapEntries() { this.additionalPlanOptionsMap = null; 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 (getMapping() != null) sb.append("Mapping: ").append(getMapping()).append(","); if (getSource() != null) sb.append("Source: ").append(getSource()).append(","); if (getSinks() != null) sb.append("Sinks: ").append(getSinks()).append(","); if (getLocation() != null) sb.append("Location: ").append(getLocation()).append(","); if (getLanguage() != null) sb.append("Language: ").append(getLanguage()).append(","); if (getAdditionalPlanOptionsMap() != null) sb.append("AdditionalPlanOptionsMap: ").append(getAdditionalPlanOptionsMap()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetPlanRequest == false) return false; GetPlanRequest other = (GetPlanRequest) obj; if (other.getMapping() == null ^ this.getMapping() == null) return false; if (other.getMapping() != null && other.getMapping().equals(this.getMapping()) == false) return false; if (other.getSource() == null ^ this.getSource() == null) return false; if (other.getSource() != null && other.getSource().equals(this.getSource()) == false) return false; if (other.getSinks() == null ^ this.getSinks() == null) return false; if (other.getSinks() != null && other.getSinks().equals(this.getSinks()) == false) return false; if (other.getLocation() == null ^ this.getLocation() == null) return false; if (other.getLocation() != null && other.getLocation().equals(this.getLocation()) == false) return false; if (other.getLanguage() == null ^ this.getLanguage() == null) return false; if (other.getLanguage() != null && other.getLanguage().equals(this.getLanguage()) == false) return false; if (other.getAdditionalPlanOptionsMap() == null ^ this.getAdditionalPlanOptionsMap() == null) return false; if (other.getAdditionalPlanOptionsMap() != null && other.getAdditionalPlanOptionsMap().equals(this.getAdditionalPlanOptionsMap()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getMapping() == null) ? 0 : getMapping().hashCode()); hashCode = prime * hashCode + ((getSource() == null) ? 0 : getSource().hashCode()); hashCode = prime * hashCode + ((getSinks() == null) ? 0 : getSinks().hashCode()); hashCode = prime * hashCode + ((getLocation() == null) ? 0 : getLocation().hashCode()); hashCode = prime * hashCode + ((getLanguage() == null) ? 0 : getLanguage().hashCode()); hashCode = prime * hashCode + ((getAdditionalPlanOptionsMap() == null) ? 0 : getAdditionalPlanOptionsMap().hashCode()); return hashCode; } @Override public GetPlanRequest clone() { return (GetPlanRequest) super.clone(); } }