@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributePayload() == null) ? 0 : getAttributePayload().hashCode()); hashCode = prime * hashCode + ((getBillingGroupName() == null) ? 0 : getBillingGroupName().hashCode()); return hashCode; }
/** * <p> * The attribute payload, which consists of up to three name/value pairs in a JSON document. For example: * </p> * <p> * <code>{\"attributes\":{\"string1\":\"string2\"}}</code> * </p> * * @param attributePayload * The attribute payload, which consists of up to three name/value pairs in a JSON document. For example:</p> * <p> * <code>{\"attributes\":{\"string1\":\"string2\"}}</code> * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withAttributePayload(AttributePayload attributePayload) { setAttributePayload(attributePayload); return this; }
/** * <p> * The name of the billing group the thing will be added to. * </p> * * @param billingGroupName * The name of the billing group the thing will be added to. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withBillingGroupName(String billingGroupName) { setBillingGroupName(billingGroupName); return this; }
CreateThingResult resp1 = getClient().createThing(new CreateThingRequest().withThingName(id). withAttributePayload(new AttributePayload().addAttributesEntry(Config._APPID, appid)));
/** * <p> * The name of the thing to create. * </p> * * @param thingName * The name of the thing to create. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withThingName(String thingName) { setThingName(thingName); return this; }
/** * <p> * The name of the thing type associated with the new thing. * </p> * * @param thingTypeName * The name of the thing type associated with the new thing. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withThingTypeName(String thingTypeName) { setThingTypeName(thingTypeName); return this; }
CreateThingResult resp1 = getClient().createThing(new CreateThingRequest().withThingName(id). withAttributePayload(new AttributePayload().addAttributesEntry(Config._APPID, appid)));
/** * <p> * The name of the thing to create. * </p> * * @param thingName * The name of the thing to create. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withThingName(String thingName) { setThingName(thingName); return this; }
/** * <p> * The name of the thing type associated with the new thing. * </p> * * @param thingTypeName * The name of the thing type associated with the new thing. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withThingTypeName(String thingTypeName) { setThingTypeName(thingTypeName); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateThingRequest == false) return false; CreateThingRequest other = (CreateThingRequest) obj; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) return false; if (other.getThingTypeName() != null && other.getThingTypeName().equals(this.getThingTypeName()) == false) return false; if (other.getAttributePayload() == null ^ this.getAttributePayload() == null) return false; if (other.getAttributePayload() != null && other.getAttributePayload().equals(this.getAttributePayload()) == false) return false; if (other.getBillingGroupName() == null ^ this.getBillingGroupName() == null) return false; if (other.getBillingGroupName() != null && other.getBillingGroupName().equals(this.getBillingGroupName()) == false) return false; return true; }
/** * <p> * The name of the billing group the thing will be added to. * </p> * * @param billingGroupName * The name of the billing group the thing will be added to. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withBillingGroupName(String billingGroupName) { setBillingGroupName(billingGroupName); return this; }
/** * <p> * The attribute payload, which consists of up to three name/value pairs in a JSON document. For example: * </p> * <p> * <code>{\"attributes\":{\"string1\":\"string2\"}}</code> * </p> * * @param attributePayload * The attribute payload, which consists of up to three name/value pairs in a JSON document. For example:</p> * <p> * <code>{\"attributes\":{\"string1\":\"string2\"}}</code> * @return Returns a reference to this object so that method calls can be chained together. */ public CreateThingRequest withAttributePayload(AttributePayload attributePayload) { setAttributePayload(attributePayload); 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 (getThingName() != null) sb.append("ThingName: ").append(getThingName()).append(","); if (getThingTypeName() != null) sb.append("ThingTypeName: ").append(getThingTypeName()).append(","); if (getAttributePayload() != null) sb.append("AttributePayload: ").append(getAttributePayload()).append(","); if (getBillingGroupName() != null) sb.append("BillingGroupName: ").append(getBillingGroupName()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(CreateThingRequest createThingRequest, ProtocolMarshaller protocolMarshaller) { if (createThingRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createThingRequest.getThingName(), THINGNAME_BINDING); protocolMarshaller.marshall(createThingRequest.getThingTypeName(), THINGTYPENAME_BINDING); protocolMarshaller.marshall(createThingRequest.getAttributePayload(), ATTRIBUTEPAYLOAD_BINDING); protocolMarshaller.marshall(createThingRequest.getBillingGroupName(), BILLINGGROUPNAME_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 + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributePayload() == null) ? 0 : getAttributePayload().hashCode()); hashCode = prime * hashCode + ((getBillingGroupName() == null) ? 0 : getBillingGroupName().hashCode()); return hashCode; }
CreateThingRequest other = (CreateThingRequest) obj; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == false) return false; if (other.getThingTypeName() == null ^ this.getThingTypeName() == null) return false; if (other.getThingTypeName() != null && other.getThingTypeName().equals(this.getThingTypeName()) == false) return false; if (other.getAttributePayload() == null ^ this.getAttributePayload() == null) return false; if (other.getAttributePayload() != null && other.getAttributePayload().equals(this.getAttributePayload()) == false) return false; if (other.getBillingGroupName() == null ^ this.getBillingGroupName() == null) return false; if (other.getBillingGroupName() != null && other.getBillingGroupName().equals(this.getBillingGroupName()) == 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 (getThingName() != null) sb.append("thingName: " + getThingName() + ","); if (getThingTypeName() != null) sb.append("thingTypeName: " + getThingTypeName() + ","); if (getAttributePayload() != null) sb.append("attributePayload: " + getAttributePayload() + ","); if (getBillingGroupName() != null) sb.append("billingGroupName: " + getBillingGroupName()); sb.append("}"); return sb.toString(); }
uriResourcePath = uriResourcePath.replace( "{thingName}", (createThingRequest.getThingName() == null) ? "" : StringUtils .fromString(createThingRequest.getThingName())); request.setResourcePath(uriResourcePath); try { jsonWriter.beginObject(); if (createThingRequest.getThingTypeName() != null) { String thingTypeName = createThingRequest.getThingTypeName(); jsonWriter.name("thingTypeName"); jsonWriter.value(thingTypeName); if (createThingRequest.getAttributePayload() != null) { AttributePayload attributePayload = createThingRequest.getAttributePayload(); jsonWriter.name("attributePayload"); AttributePayloadJsonMarshaller.getInstance().marshall(attributePayload, jsonWriter); if (createThingRequest.getBillingGroupName() != null) { String billingGroupName = createThingRequest.getBillingGroupName(); jsonWriter.name("billingGroupName"); jsonWriter.value(billingGroupName);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributePayload() == null) ? 0 : getAttributePayload().hashCode()); hashCode = prime * hashCode + ((getBillingGroupName() == null) ? 0 : getBillingGroupName().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getThingTypeName() == null) ? 0 : getThingTypeName().hashCode()); hashCode = prime * hashCode + ((getAttributePayload() == null) ? 0 : getAttributePayload().hashCode()); hashCode = prime * hashCode + ((getBillingGroupName() == null) ? 0 : getBillingGroupName().hashCode()); return hashCode; }