@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVocabularyName() == null) ? 0 : getVocabularyName().hashCode()); hashCode = prime * hashCode + ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode()); hashCode = prime * hashCode + ((getPhrases() == null) ? 0 : getPhrases().hashCode()); return hashCode; }
/** * <p> * An array of strings that contains the vocabulary entries. * </p> * * @param phrases * An array of strings that contains the vocabulary entries. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVocabularyRequest withPhrases(java.util.Collection<String> phrases) { setPhrases(phrases); return this; }
/** * <p> * The language code of the vocabulary entries. * </p> * * @param languageCode * The language code of the vocabulary entries. * @return Returns a reference to this object so that method calls can be chained together. * @see LanguageCode */ public CreateVocabularyRequest withLanguageCode(String languageCode) { setLanguageCode(languageCode); return this; }
/** * <p> * An array of strings that contains the vocabulary entries. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param phrases <p> * An array of strings that contains the vocabulary entries. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CreateVocabularyRequest withPhrases(String... phrases) { if (getPhrases() == null) { this.phrases = new java.util.ArrayList<String>(phrases.length); } for (String value : phrases) { this.phrases.add(value); } return this; }
/** * <p> * The name of the vocabulary. The name must be unique within an AWS account. The name is case-sensitive. * </p> * * @param vocabularyName * The name of the vocabulary. The name must be unique within an AWS account. The name is case-sensitive. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVocabularyRequest withVocabularyName(String vocabularyName) { setVocabularyName(vocabularyName); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateVocabularyRequest == false) return false; CreateVocabularyRequest other = (CreateVocabularyRequest) obj; if (other.getVocabularyName() == null ^ this.getVocabularyName() == null) return false; if (other.getVocabularyName() != null && other.getVocabularyName().equals(this.getVocabularyName()) == false) return false; if (other.getLanguageCode() == null ^ this.getLanguageCode() == null) return false; if (other.getLanguageCode() != null && other.getLanguageCode().equals(this.getLanguageCode()) == false) return false; if (other.getPhrases() == null ^ this.getPhrases() == null) return false; if (other.getPhrases() != null && other.getPhrases().equals(this.getPhrases()) == false) return false; return true; }
/** * <p> * An array of strings that contains the vocabulary entries. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setPhrases(java.util.Collection)} or {@link #withPhrases(java.util.Collection)} if you want to override * the existing values. * </p> * * @param phrases * An array of strings that contains the vocabulary entries. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateVocabularyRequest withPhrases(String... phrases) { if (this.phrases == null) { setPhrases(new java.util.ArrayList<String>(phrases.length)); } for (String ele : phrases) { this.phrases.add(ele); } 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 (getVocabularyName() != null) sb.append("VocabularyName: ").append(getVocabularyName()).append(","); if (getLanguageCode() != null) sb.append("LanguageCode: ").append(getLanguageCode()).append(","); if (getPhrases() != null) sb.append("Phrases: ").append(getPhrases()); sb.append("}"); return sb.toString(); }
/** * <p> * An array of strings that contains the vocabulary entries. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param phrases <p> * An array of strings that contains the vocabulary entries. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public CreateVocabularyRequest withPhrases(java.util.Collection<String> phrases) { setPhrases(phrases); return this; }
/** * Marshall the given parameter object. */ public void marshall(CreateVocabularyRequest createVocabularyRequest, ProtocolMarshaller protocolMarshaller) { if (createVocabularyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createVocabularyRequest.getVocabularyName(), VOCABULARYNAME_BINDING); protocolMarshaller.marshall(createVocabularyRequest.getLanguageCode(), LANGUAGECODE_BINDING); protocolMarshaller.marshall(createVocabularyRequest.getPhrases(), PHRASES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVocabularyName() == null) ? 0 : getVocabularyName().hashCode()); hashCode = prime * hashCode + ((getLanguageCode() == null) ? 0 : getLanguageCode().hashCode()); hashCode = prime * hashCode + ((getPhrases() == null) ? 0 : getPhrases().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateVocabularyRequest == false) return false; CreateVocabularyRequest other = (CreateVocabularyRequest) obj; if (other.getVocabularyName() == null ^ this.getVocabularyName() == null) return false; if (other.getVocabularyName() != null && other.getVocabularyName().equals(this.getVocabularyName()) == false) return false; if (other.getLanguageCode() == null ^ this.getLanguageCode() == null) return false; if (other.getLanguageCode() != null && other.getLanguageCode().equals(this.getLanguageCode()) == false) return false; if (other.getPhrases() == null ^ this.getPhrases() == null) return false; if (other.getPhrases() != null && other.getPhrases().equals(this.getPhrases()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getVocabularyName() != null) sb.append("VocabularyName: " + getVocabularyName() + ","); if (getLanguageCode() != null) sb.append("LanguageCode: " + getLanguageCode() + ","); if (getPhrases() != null) sb.append("Phrases: " + getPhrases()); sb.append("}"); return sb.toString(); }
jsonWriter.beginObject(); if (createVocabularyRequest.getVocabularyName() != null) { String vocabularyName = createVocabularyRequest.getVocabularyName(); jsonWriter.name("VocabularyName"); jsonWriter.value(vocabularyName); if (createVocabularyRequest.getLanguageCode() != null) { String languageCode = createVocabularyRequest.getLanguageCode(); jsonWriter.name("LanguageCode"); jsonWriter.value(languageCode); if (createVocabularyRequest.getPhrases() != null) { java.util.List<String> phrases = createVocabularyRequest.getPhrases(); jsonWriter.name("Phrases"); jsonWriter.beginArray();