@Override public int compareTo(@SuppressWarnings("NullableProblems") ColumnValue other) { int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); if (lastComparison == 0) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(primitiveValue, other.primitiveValue); } if (lastComparison == 0) { return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); } return lastComparison; }
public boolean equals(ColumnValue other) { return other != null && getSetField() == other.getSetField() && primitiveValue == other.primitiveValue && getFieldValue().equals(other.getFieldValue()); }
@Override public int hashCode() { int hash = 1; hash = 31 * hash + this.getClass().getName().hashCode(); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { hash = 31 * hash + setField.getThriftFieldId(); Object value = getFieldValue(); if (value == null) { hash = 31 * hash + (int)(primitiveValue ^ (primitiveValue >>> 32)); } else if (value instanceof org.apache.thrift.TEnum) { hash = 31 * hash + ((org.apache.thrift.TEnum)getFieldValue()).getValue(); } else { hash = 31 * hash + value.hashCode(); } } return hash; } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
@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 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 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 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); } }
public byte[] getBinary_val() { if (getSetField() == _Fields.BINARY_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)); setBinary_val(buffer); } return buffer.array(); } else { throw new RuntimeException( "Cannot get field 'binary_val' because union is currently set to " + getFieldDesc(getSetField()).name); } }
fieldVal = cv.getFieldValue(); sqlTypeId = SnappyType.VARCHAR.getValue(); break; break; case DECIMAL_VAL: Decimal decimal = (Decimal)cv.getFieldValue(); fieldVal = decimal != null ? Converters.getBigDecimal(decimal) : null; sqlTypeId = SnappyType.DECIMAL.getValue(); break; case CLOB_VAL: fieldVal = cv.getFieldValue(); sqlTypeId = SnappyType.CLOB.getValue(); hasLobs = true; break; case BLOB_VAL: fieldVal = cv.getFieldValue(); sqlTypeId = SnappyType.BLOB.getValue(); hasLobs = true; return; case ARRAY_VAL: fieldVal = cv.getFieldValue(); sqlTypeId = SnappyType.ARRAY.getValue(); break; case MAP_VAL: fieldVal = cv.getFieldValue(); sqlTypeId = SnappyType.MAP.getValue();