@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getItemCount() == null) ? 0 : getItemCount().hashCode()); hashCode = prime * hashCode + ((getItemNamesSizeBytes() == null) ? 0 : getItemNamesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getAttributeNameCount() == null) ? 0 : getAttributeNameCount().hashCode()); hashCode = prime * hashCode + ((getAttributeNamesSizeBytes() == null) ? 0 : getAttributeNamesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getAttributeValueCount() == null) ? 0 : getAttributeValueCount().hashCode()); hashCode = prime * hashCode + ((getAttributeValuesSizeBytes() == null) ? 0 : getAttributeValuesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); return hashCode; }
/** * The number of unique attribute names in the domain. * * @param attributeNameCount * The number of unique attribute names in the domain. * @return Returns a reference to this object so that method calls can be chained together. */ public DomainMetadataResult withAttributeNameCount(Integer attributeNameCount) { setAttributeNameCount(attributeNameCount); return this; }
/** * The total size of all unique attribute names in the domain, in bytes. * * @param attributeNamesSizeBytes * The total size of all unique attribute names in the domain, in bytes. * @return Returns a reference to this object so that method calls can be chained together. */ public DomainMetadataResult withAttributeNamesSizeBytes(Long attributeNamesSizeBytes) { setAttributeNamesSizeBytes(attributeNamesSizeBytes); return this; }
public DomainMetadataResult unmarshall(StaxUnmarshallerContext context) throws Exception { DomainMetadataResult domainMetadataResult = new DomainMetadataResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; domainMetadataResult.setItemCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setItemNamesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeNameCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeNamesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeValueCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeValuesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setTimestamp(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@Override public Set<SimpleDBAttribute> getAttributeNames(String domainName) throws TranslatorException { DomainMetadataRequest domainMetadataRequest = new DomainMetadataRequest(domainName); DomainMetadataResult metadataResult = client.domainMetadata(domainMetadataRequest); int attributesCount = metadataResult.getAttributeNameCount(); SelectResult selectResult = client.select(new SelectRequest("SELECT * FROM " + SimpleDBUtils.quoteName(domainName))); //$NON-NLS-1$ return getAttributeNamesFromSelectResult(selectResult, attributesCount); }
public DomainMetadataResult unmarshall(StaxUnmarshallerContext context) throws Exception { DomainMetadataResult domainMetadataResult = new DomainMetadataResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; domainMetadataResult.setItemCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setItemNamesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeNameCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeNamesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeValueCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeValuesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setTimestamp(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue;
return false; DomainMetadataResult other = (DomainMetadataResult) obj; if (other.getItemCount() == null ^ this.getItemCount() == null) return false; if (other.getItemCount() != null && other.getItemCount().equals(this.getItemCount()) == false) return false; if (other.getItemNamesSizeBytes() == null ^ this.getItemNamesSizeBytes() == null) return false; if (other.getItemNamesSizeBytes() != null && other.getItemNamesSizeBytes().equals(this.getItemNamesSizeBytes()) == false) return false; if (other.getAttributeNameCount() == null ^ this.getAttributeNameCount() == null) return false; if (other.getAttributeNameCount() != null && other.getAttributeNameCount().equals(this.getAttributeNameCount()) == false) return false; if (other.getAttributeNamesSizeBytes() == null ^ this.getAttributeNamesSizeBytes() == null) return false; if (other.getAttributeNamesSizeBytes() != null && other.getAttributeNamesSizeBytes().equals(this.getAttributeNamesSizeBytes()) == false) return false; if (other.getAttributeValueCount() == null ^ this.getAttributeValueCount() == null) return false; if (other.getAttributeValueCount() != null && other.getAttributeValueCount().equals(this.getAttributeValueCount()) == false) return false; if (other.getAttributeValuesSizeBytes() == null ^ this.getAttributeValuesSizeBytes() == null) return false; if (other.getAttributeValuesSizeBytes() != null && other.getAttributeValuesSizeBytes().equals(this.getAttributeValuesSizeBytes()) == false) return false; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false)
public DomainMetadataResult unmarshall(StaxUnmarshallerContext context) throws Exception { DomainMetadataResult domainMetadataResult = new DomainMetadataResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; domainMetadataResult.setItemCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setItemNamesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeNameCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeNamesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeValueCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setAttributeValuesSizeBytes(LongStaxUnmarshaller.getInstance().unmarshall(context)); continue; domainMetadataResult.setTimestamp(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue;
/** * The number of unique attribute names in the domain. * * @param attributeNameCount * The number of unique attribute names in the domain. * @return Returns a reference to this object so that method calls can be chained together. */ public DomainMetadataResult withAttributeNameCount(Integer attributeNameCount) { setAttributeNameCount(attributeNameCount); return this; }
/** * The total size of all unique attribute names in the domain, in bytes. * * @param attributeNamesSizeBytes * The total size of all unique attribute names in the domain, in bytes. * @return Returns a reference to this object so that method calls can be chained together. */ public DomainMetadataResult withAttributeNamesSizeBytes(Long attributeNamesSizeBytes) { setAttributeNamesSizeBytes(attributeNamesSizeBytes); 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 (getItemCount() != null) sb.append("ItemCount: ").append(getItemCount()).append(","); if (getItemNamesSizeBytes() != null) sb.append("ItemNamesSizeBytes: ").append(getItemNamesSizeBytes()).append(","); if (getAttributeNameCount() != null) sb.append("AttributeNameCount: ").append(getAttributeNameCount()).append(","); if (getAttributeNamesSizeBytes() != null) sb.append("AttributeNamesSizeBytes: ").append(getAttributeNamesSizeBytes()).append(","); if (getAttributeValueCount() != null) sb.append("AttributeValueCount: ").append(getAttributeValueCount()).append(","); if (getAttributeValuesSizeBytes() != null) sb.append("AttributeValuesSizeBytes: ").append(getAttributeValuesSizeBytes()).append(","); if (getTimestamp() != null) sb.append("Timestamp: ").append(getTimestamp()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getItemCount() == null) ? 0 : getItemCount().hashCode()); hashCode = prime * hashCode + ((getItemNamesSizeBytes() == null) ? 0 : getItemNamesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getAttributeNameCount() == null) ? 0 : getAttributeNameCount().hashCode()); hashCode = prime * hashCode + ((getAttributeNamesSizeBytes() == null) ? 0 : getAttributeNamesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getAttributeValueCount() == null) ? 0 : getAttributeValueCount().hashCode()); hashCode = prime * hashCode + ((getAttributeValuesSizeBytes() == null) ? 0 : getAttributeValuesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DomainMetadataResult == false) return false; DomainMetadataResult other = (DomainMetadataResult)obj; if (other.getItemCount() == null ^ this.getItemCount() == null) return false; if (other.getItemCount() != null && other.getItemCount().equals(this.getItemCount()) == false) return false; if (other.getItemNamesSizeBytes() == null ^ this.getItemNamesSizeBytes() == null) return false; if (other.getItemNamesSizeBytes() != null && other.getItemNamesSizeBytes().equals(this.getItemNamesSizeBytes()) == false) return false; if (other.getAttributeNameCount() == null ^ this.getAttributeNameCount() == null) return false; if (other.getAttributeNameCount() != null && other.getAttributeNameCount().equals(this.getAttributeNameCount()) == false) return false; if (other.getAttributeNamesSizeBytes() == null ^ this.getAttributeNamesSizeBytes() == null) return false; if (other.getAttributeNamesSizeBytes() != null && other.getAttributeNamesSizeBytes().equals(this.getAttributeNamesSizeBytes()) == false) return false; if (other.getAttributeValueCount() == null ^ this.getAttributeValueCount() == null) return false; if (other.getAttributeValueCount() != null && other.getAttributeValueCount().equals(this.getAttributeValueCount()) == false) return false; if (other.getAttributeValuesSizeBytes() == null ^ this.getAttributeValuesSizeBytes() == null) return false; if (other.getAttributeValuesSizeBytes() != null && other.getAttributeValuesSizeBytes().equals(this.getAttributeValuesSizeBytes()) == false) return false; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == 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 (getItemCount() != null) sb.append("ItemCount: " + getItemCount() + ","); if (getItemNamesSizeBytes() != null) sb.append("ItemNamesSizeBytes: " + getItemNamesSizeBytes() + ","); if (getAttributeNameCount() != null) sb.append("AttributeNameCount: " + getAttributeNameCount() + ","); if (getAttributeNamesSizeBytes() != null) sb.append("AttributeNamesSizeBytes: " + getAttributeNamesSizeBytes() + ","); if (getAttributeValueCount() != null) sb.append("AttributeValueCount: " + getAttributeValueCount() + ","); if (getAttributeValuesSizeBytes() != null) sb.append("AttributeValuesSizeBytes: " + getAttributeValuesSizeBytes() + ","); if (getTimestamp() != null) sb.append("Timestamp: " + getTimestamp() ); sb.append("}"); return sb.toString(); }
assertNotNull(domainMetadataResult.getItemCount()); assertTrue(domainMetadataResult.getItemCount().equals(1)); assertNotNull(domainMetadataResult.getItemNamesSizeBytes()); assertTrue(domainMetadataResult.getItemNamesSizeBytes().equals(1L)); assertNotNull(domainMetadataResult.getAttributeNameCount()); assertTrue(domainMetadataResult.getAttributeNameCount().equals(1)); assertNotNull(domainMetadataResult.getAttributeNamesSizeBytes()); assertTrue(domainMetadataResult.getAttributeNamesSizeBytes().equals(1L)); assertNotNull(domainMetadataResult.getAttributeValueCount()); assertTrue(domainMetadataResult.getAttributeValueCount().equals(1)); assertNotNull(domainMetadataResult.getAttributeValuesSizeBytes()); assertTrue(domainMetadataResult.getAttributeValuesSizeBytes().equals(1L)); assertNotNull(domainMetadataResult.getTimestamp()); assertTrue(domainMetadataResult.getTimestamp().equals(1));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getItemCount() == null) ? 0 : getItemCount().hashCode()); hashCode = prime * hashCode + ((getItemNamesSizeBytes() == null) ? 0 : getItemNamesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getAttributeNameCount() == null) ? 0 : getAttributeNameCount().hashCode()); hashCode = prime * hashCode + ((getAttributeNamesSizeBytes() == null) ? 0 : getAttributeNamesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getAttributeValueCount() == null) ? 0 : getAttributeValueCount().hashCode()); hashCode = prime * hashCode + ((getAttributeValuesSizeBytes() == null) ? 0 : getAttributeValuesSizeBytes().hashCode()); hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); return hashCode; }
return false; DomainMetadataResult other = (DomainMetadataResult) obj; if (other.getItemCount() == null ^ this.getItemCount() == null) return false; if (other.getItemCount() != null && other.getItemCount().equals(this.getItemCount()) == false) return false; if (other.getItemNamesSizeBytes() == null ^ this.getItemNamesSizeBytes() == null) return false; if (other.getItemNamesSizeBytes() != null && other.getItemNamesSizeBytes().equals(this.getItemNamesSizeBytes()) == false) return false; if (other.getAttributeNameCount() == null ^ this.getAttributeNameCount() == null) return false; if (other.getAttributeNameCount() != null && other.getAttributeNameCount().equals(this.getAttributeNameCount()) == false) return false; if (other.getAttributeNamesSizeBytes() == null ^ this.getAttributeNamesSizeBytes() == null) return false; if (other.getAttributeNamesSizeBytes() != null && other.getAttributeNamesSizeBytes().equals(this.getAttributeNamesSizeBytes()) == false) return false; if (other.getAttributeValueCount() == null ^ this.getAttributeValueCount() == null) return false; if (other.getAttributeValueCount() != null && other.getAttributeValueCount().equals(this.getAttributeValueCount()) == false) return false; if (other.getAttributeValuesSizeBytes() == null ^ this.getAttributeValuesSizeBytes() == null) return false; if (other.getAttributeValuesSizeBytes() != null && other.getAttributeValuesSizeBytes().equals(this.getAttributeValuesSizeBytes()) == false) return false; if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false; if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false)
/** * 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 (getItemCount() != null) sb.append("ItemCount: ").append(getItemCount()).append(","); if (getItemNamesSizeBytes() != null) sb.append("ItemNamesSizeBytes: ").append(getItemNamesSizeBytes()).append(","); if (getAttributeNameCount() != null) sb.append("AttributeNameCount: ").append(getAttributeNameCount()).append(","); if (getAttributeNamesSizeBytes() != null) sb.append("AttributeNamesSizeBytes: ").append(getAttributeNamesSizeBytes()).append(","); if (getAttributeValueCount() != null) sb.append("AttributeValueCount: ").append(getAttributeValueCount()).append(","); if (getAttributeValuesSizeBytes() != null) sb.append("AttributeValuesSizeBytes: ").append(getAttributeValuesSizeBytes()).append(","); if (getTimestamp() != null) sb.append("Timestamp: ").append(getTimestamp()); sb.append("}"); return sb.toString(); }