public Object getFieldValue(F fieldId) { if (fieldId != setField_) { throw new IllegalArgumentException("Cannot get the value of field " + fieldId + " because union's set field is " + setField_); } return getFieldValue(); }
public Object getFieldValue(F fieldId) { if (fieldId != setField_) { throw new IllegalArgumentException("Cannot get the value of field " + fieldId + " because union's set field is " + setField_); } return getFieldValue(); }
public Object getFieldValue(int fieldId) { return getFieldValue(enumForId((short)fieldId)); }
public Object getFieldValue(int fieldId) { return getFieldValue(enumForId((short)fieldId)); }
@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.writeI16(struct.setField_.getThriftFieldId()); struct.tupleSchemeWriteValue(oprot); } }
@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.writeI16(struct.setField_.getThriftFieldId()); struct.tupleSchemeWriteValue(oprot); } }
@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(); } }