if (isSetStale()) { if (!first) sb.append(", "); sb.append("stale:");
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); } switch (field) { case ROW: return isSetRow(); case COLUMN_VALUES: return isSetColumnValues(); case STALE: return isSetStale(); case PARTIAL: return isSetPartial(); } throw new java.lang.IllegalStateException(); }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetRow()) ? 131071 : 524287); if (isSetRow()) hashCode = hashCode * 8191 + row.hashCode(); hashCode = hashCode * 8191 + ((isSetColumnValues()) ? 131071 : 524287); if (isSetColumnValues()) hashCode = hashCode * 8191 + columnValues.hashCode(); hashCode = hashCode * 8191 + ((isSetStale()) ? 131071 : 524287); if (isSetStale()) hashCode = hashCode * 8191 + ((stale) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetPartial()) ? 131071 : 524287); if (isSetPartial()) hashCode = hashCode * 8191 + ((partial) ? 131071 : 524287); return hashCode; }
lastComparison = java.lang.Boolean.valueOf(isSetStale()).compareTo(other.isSetStale()); if (lastComparison != 0) { return lastComparison; if (isSetStale()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stale, other.stale); if (lastComparison != 0) {
if (struct.isSetStale()) { oprot.writeFieldBegin(STALE_FIELD_DESC); oprot.writeBool(struct.stale);
boolean this_present_stale = true && this.isSetStale(); boolean that_present_stale = true && that.isSetStale(); if (this_present_stale || that_present_stale) { if (!(this_present_stale && that_present_stale))
optionals.set(0); if (struct.isSetStale()) { optionals.set(1); oprot.writeBinary(struct.row); if (struct.isSetStale()) { oprot.writeBool(struct.stale);
@Test public void testConsistency() throws Exception { byte[] rowName = Bytes.toBytes("testConsistency"); TGet tGet = new TGet(wrap(rowName)); tGet.setConsistency(TConsistency.STRONG); Get get = getFromThrift(tGet); assertEquals(Consistency.STRONG, get.getConsistency()); tGet.setConsistency(TConsistency.TIMELINE); tGet.setTargetReplicaId(1); get = getFromThrift(tGet); assertEquals(Consistency.TIMELINE, get.getConsistency()); assertEquals(1, get.getReplicaId()); TScan tScan = new TScan(); tScan.setConsistency(TConsistency.STRONG); Scan scan = scanFromThrift(tScan); assertEquals(Consistency.STRONG, scan.getConsistency()); tScan.setConsistency(TConsistency.TIMELINE); tScan.setTargetReplicaId(1); scan = scanFromThrift(tScan); assertEquals(Consistency.TIMELINE, scan.getConsistency()); assertEquals(1, scan.getReplicaId()); TResult tResult = new TResult(); assertFalse(tResult.isSetStale()); tResult.setStale(true); assertTrue(tResult.isSetStale()); }