@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("<"); sb.append(this.getClass().getSimpleName()); sb.append(" "); if (getSetField() != null) { Object v = getFieldValue(); sb.append(getFieldDesc(getSetField()).name); sb.append(":"); if(v instanceof ByteBuffer) { TBaseHelper.toString((ByteBuffer)v, sb); } else { sb.append(v.toString()); } } sb.append(">"); return sb.toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("<"); sb.append(this.getClass().getSimpleName()); sb.append(" "); if (getSetField() != null) { Object v = getFieldValue(); sb.append(getFieldDesc(getSetField()).name); sb.append(":"); if(v instanceof ByteBuffer) { TBaseHelper.toString((ByteBuffer)v, sb); } else { sb.append(v.toString()); } } sb.append(">"); return sb.toString(); }
@Override public void write(TProtocol oprot, TUnion struct) throws TException { if (struct.getSetField() == null || struct.getFieldValue() == null) { throw new TProtocolException("Cannot write a TUnion with no set value!"); } oprot.writeStructBegin(struct.getStructDesc()); oprot.writeFieldBegin(struct.getFieldDesc(struct.setField_)); struct.standardSchemeWriteValue(oprot); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } }
@Override public void write(TProtocol oprot, TUnion struct) throws TException { if (struct.getSetField() == null || struct.getFieldValue() == null) { throw new TProtocolException("Cannot write a TUnion with no set value!"); } oprot.writeStructBegin(struct.getStructDesc()); oprot.writeFieldBegin(struct.getFieldDesc(struct.setField_)); struct.standardSchemeWriteValue(oprot); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } }