/** * 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. */ @Override public String toString() { return ToString.builder("SchemaAttributeType").add("Name", name()).add("AttributeDataType", attributeDataTypeAsString()) .add("DeveloperOnlyAttribute", developerOnlyAttribute()).add("Mutable", mutable()).add("Required", required()) .add("NumberAttributeConstraints", numberAttributeConstraints()) .add("StringAttributeConstraints", stringAttributeConstraints()).build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(attributeDataTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(developerOnlyAttribute()); hashCode = 31 * hashCode + Objects.hashCode(mutable()); hashCode = 31 * hashCode + Objects.hashCode(required()); hashCode = 31 * hashCode + Objects.hashCode(numberAttributeConstraints()); hashCode = 31 * hashCode + Objects.hashCode(stringAttributeConstraints()); return hashCode; }
@Override public String toString() { return ToString.builder("SchemaAttributeType").add("Name", name()).add("AttributeDataType", attributeDataTypeAsString()) .add("DeveloperOnlyAttribute", developerOnlyAttribute()).add("Mutable", mutable()).add("Required", required()) .add("NumberAttributeConstraints", numberAttributeConstraints()) .add("StringAttributeConstraints", stringAttributeConstraints()).build(); }
@Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(attributeDataTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(developerOnlyAttribute()); hashCode = 31 * hashCode + Objects.hashCode(mutable()); hashCode = 31 * hashCode + Objects.hashCode(required()); hashCode = 31 * hashCode + Objects.hashCode(numberAttributeConstraints()); hashCode = 31 * hashCode + Objects.hashCode(stringAttributeConstraints()); return hashCode; }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "AttributeDataType": return Optional.ofNullable(clazz.cast(attributeDataTypeAsString())); case "DeveloperOnlyAttribute": return Optional.ofNullable(clazz.cast(developerOnlyAttribute())); case "Mutable": return Optional.ofNullable(clazz.cast(mutable())); case "Required": return Optional.ofNullable(clazz.cast(required())); case "NumberAttributeConstraints": return Optional.ofNullable(clazz.cast(numberAttributeConstraints())); case "StringAttributeConstraints": return Optional.ofNullable(clazz.cast(stringAttributeConstraints())); default: return Optional.empty(); } }
public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "AttributeDataType": return Optional.ofNullable(clazz.cast(attributeDataTypeAsString())); case "DeveloperOnlyAttribute": return Optional.ofNullable(clazz.cast(developerOnlyAttribute())); case "Mutable": return Optional.ofNullable(clazz.cast(mutable())); case "Required": return Optional.ofNullable(clazz.cast(required())); case "NumberAttributeConstraints": return Optional.ofNullable(clazz.cast(numberAttributeConstraints())); case "StringAttributeConstraints": return Optional.ofNullable(clazz.cast(stringAttributeConstraints())); default: return Optional.empty(); } }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SchemaAttributeType)) { return false; } SchemaAttributeType other = (SchemaAttributeType) obj; return Objects.equals(name(), other.name()) && Objects.equals(attributeDataTypeAsString(), other.attributeDataTypeAsString()) && Objects.equals(developerOnlyAttribute(), other.developerOnlyAttribute()) && Objects.equals(mutable(), other.mutable()) && Objects.equals(required(), other.required()) && Objects.equals(numberAttributeConstraints(), other.numberAttributeConstraints()) && Objects.equals(stringAttributeConstraints(), other.stringAttributeConstraints()); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof SchemaAttributeType)) { return false; } SchemaAttributeType other = (SchemaAttributeType) obj; return Objects.equals(name(), other.name()) && Objects.equals(attributeDataTypeAsString(), other.attributeDataTypeAsString()) && Objects.equals(developerOnlyAttribute(), other.developerOnlyAttribute()) && Objects.equals(mutable(), other.mutable()) && Objects.equals(required(), other.required()) && Objects.equals(numberAttributeConstraints(), other.numberAttributeConstraints()) && Objects.equals(stringAttributeConstraints(), other.stringAttributeConstraints()); }
/** * Marshall the given parameter object */ public void marshall(SchemaAttributeType schemaAttributeType, ProtocolMarshaller protocolMarshaller) { Validate.paramNotNull(schemaAttributeType, "schemaAttributeType"); Validate.paramNotNull(protocolMarshaller, "protocolMarshaller"); try { protocolMarshaller.marshall(schemaAttributeType.name(), NAME_BINDING); protocolMarshaller.marshall(schemaAttributeType.attributeDataTypeAsString(), ATTRIBUTEDATATYPE_BINDING); protocolMarshaller.marshall(schemaAttributeType.developerOnlyAttribute(), DEVELOPERONLYATTRIBUTE_BINDING); protocolMarshaller.marshall(schemaAttributeType.mutable(), MUTABLE_BINDING); protocolMarshaller.marshall(schemaAttributeType.required(), REQUIRED_BINDING); protocolMarshaller.marshall(schemaAttributeType.numberAttributeConstraints(), NUMBERATTRIBUTECONSTRAINTS_BINDING); protocolMarshaller.marshall(schemaAttributeType.stringAttributeConstraints(), STRINGATTRIBUTECONSTRAINTS_BINDING); } catch (Exception e) { throw SdkClientException.builder().message("Unable to marshall request to JSON: " + e.getMessage()).cause(e).build(); } } }