@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; }
/** * 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(); }
@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; }
/** * 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); } }
/** * <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; }
@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; }
/** * 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(); }
@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; } }
jsonWriter.value(languageCode); if (createVocabularyRequest.getPhrases() != null) { java.util.List<String> phrases = createVocabularyRequest.getPhrases(); jsonWriter.name("Phrases"); jsonWriter.beginArray();