public KeyValue deepCopy() { return new KeyValue(this); }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof KeyValue) return this.equals((KeyValue)that); return false; }
/** * Performs a deep copy on <i>other</i>. */ public KeyValue(KeyValue other) { if (other.isSetKey()) { this.key = other.key; } if (other.isSetValue()) { this.value = other.value; } }
public void setFieldValue(_Fields field, Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((String)value); } break; case VALUE: if (value == null) { unsetValue(); } else { setValue((String)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.value = iprot.readString(); struct.setValueIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, KeyValue struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.key = iprot.readString(); struct.setKeyIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readString(); struct.setValueIsSet(true); } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, KeyValue struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } if (struct.value != null) { if (struct.isSetValue()) { oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeString(struct.value); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, KeyValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.key); java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetValue()) { oprot.writeString(struct.value); } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
/** * Performs a deep copy on <i>other</i>. */ public KeyValue(KeyValue other) { if (other.isSetKey()) { this.key = other.key; } if (other.isSetValue()) { this.value = other.value; } }
public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case KEY: if (value == null) { unsetKey(); } else { setKey((java.lang.String)value); } break; case VALUE: if (value == null) { unsetValue(); } else { setValue((java.lang.String)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.key = iprot.readString(); struct.setKeyIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.value = iprot.readString(); struct.setValueIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, KeyValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.key = iprot.readString(); struct.setKeyIsSet(true); java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readString(); struct.setValueIsSet(true); } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, KeyValue struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.key != null) { oprot.writeFieldBegin(KEY_FIELD_DESC); oprot.writeString(struct.key); oprot.writeFieldEnd(); } if (struct.value != null) { if (struct.isSetValue()) { oprot.writeFieldBegin(VALUE_FIELD_DESC); oprot.writeString(struct.value); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public java.lang.String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder("KeyValue("); boolean first = true; sb.append("key:"); if (this.key == null) { sb.append("null"); } else { sb.append(this.key); } first = false; if (isSetValue()) { if (!first) sb.append(", "); sb.append("value:"); if (this.value == null) { sb.append("null"); } else { sb.append(this.value); } first = false; } sb.append(")"); return sb.toString(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }