public double getDouble_val() { if (getSetField() == _Fields.DOUBLE_VAL) { return Double.longBitsToDouble(primitiveValue); } else { throw new RuntimeException("Cannot get field 'double_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public boolean getBool_val() { if (getSetField() == _Fields.BOOL_VAL) { return primitiveValue != 0L; } else { throw new RuntimeException("Cannot get field 'bool_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public byte getByte_val() { if (getSetField() == _Fields.BYTE_VAL) { return (byte)primitiveValue; } else { throw new RuntimeException("Cannot get field 'byte_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public int getI32_val() { if (getSetField() == _Fields.I32_VAL) { return (int)primitiveValue; } else { throw new RuntimeException("Cannot get field 'i32_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public short getI16_val() { if (getSetField() == _Fields.I16_VAL) { return (short)primitiveValue; } else { throw new RuntimeException("Cannot get field 'i16_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public long getDate_val() { if (getSetField() == _Fields.DATE_VAL) { return primitiveValue; } else { throw new RuntimeException("Cannot get field 'date_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public long getTime_val() { if (getSetField() == _Fields.TIME_VAL) { return primitiveValue; } else { throw new RuntimeException("Cannot get field 'time_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public long getTimestamp_val() { if (getSetField() == _Fields.TIMESTAMP_VAL) { return primitiveValue; } else { throw new RuntimeException("Cannot get field 'timestamp_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public long getI64_val() { if (getSetField() == _Fields.I64_VAL) { return primitiveValue; } else { throw new RuntimeException("Cannot get field 'i64_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public int getFloat_val() { if (getSetField() == _Fields.FLOAT_VAL) { return (int)primitiveValue; } else { throw new RuntimeException("Cannot get field 'float_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public boolean getNull_val() { if (getSetField() == _Fields.NULL_VAL) { return primitiveValue != 0L; } else { throw new RuntimeException("Cannot get field 'null_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
@Override public void write(TProtocol oprot) throws TException { if (getSetField() == null || getFieldValue() == null) { throw new TProtocolException("Cannot write a TUnion with no set value!"); } oprot.writeStructBegin(getStructDesc()); oprot.writeFieldBegin(getFieldDesc(setField_)); standardSchemeWriteValue(oprot); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); }
public Decimal getDecimal_val() { if (getSetField() == _Fields.DECIMAL_VAL) { return (Decimal)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'decimal_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public List<ColumnValue> getArray_val() { if (getSetField() == _Fields.ARRAY_VAL) { return (List<ColumnValue>)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'array_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public BlobChunk getBlob_val() { if (getSetField() == _Fields.BLOB_VAL) { return (BlobChunk)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'blob_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public ClobChunk getClob_val() { if (getSetField() == _Fields.CLOB_VAL) { return (ClobChunk)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'clob_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public String getString_val() { if (getSetField() == _Fields.STRING_VAL) { return (String)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'string_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public List<ColumnValue> getStruct_val() { if (getSetField() == _Fields.STRUCT_VAL) { return (List<ColumnValue>)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'struct_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public Map<ColumnValue,ColumnValue> getMap_val() { if (getSetField() == _Fields.MAP_VAL) { return (Map<ColumnValue,ColumnValue>)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'map_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public byte[] getJava_val() { if (getSetField() == _Fields.JAVA_VAL) { ByteBuffer buffer = (ByteBuffer)getFieldValue(); if (buffer == null) { return null; } if (!TBaseHelper.wrapsFullArray(buffer)) { // replace with byte array wrapper buffer = ByteBuffer.wrap(ThriftUtils.toBytes(buffer)); setJava_val(buffer); } return buffer.array(); } else { throw new RuntimeException( "Cannot get field 'java_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }