public OutputParameter deepCopy() { return new OutputParameter(this); }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case TYPE: return isSetType(); case SCALE: return isSetScale(); case TYPE_NAME: return isSetTypeName(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case TYPE: if (value == null) { unsetType(); } else { setType((SnappyType)value); } break; case SCALE: if (value == null) { unsetScale(); } else { setScale((Integer)value); } break; case TYPE_NAME: if (value == null) { unsetTypeName(); } else { setTypeName((String)value); } break; } }
/** * Performs a deep copy on <i>other</i>. */ public OutputParameter(OutputParameter other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetType()) { this.type = other.type; } this.scale = other.scale; if (other.isSetTypeName()) { this.typeName = other.typeName; } }
public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); case SCALE: return getScale(); case TYPE_NAME: return getTypeName(); } throw new IllegalStateException(); }
private void registerOutputParameters(CallableStatement cstmt, Map<Integer, OutputParameter> outputParams) throws SQLException { if (outputParams != null && !outputParams.isEmpty()) { OutputParameter outParam; int jdbcType; for (Map.Entry<Integer, OutputParameter> param : outputParams .entrySet()) { outParam = param.getValue(); jdbcType = Converters.getJdbcType(outParam.type); int paramPosition = param.getKey(); if (outParam.isSetScale()) { cstmt.registerOutParameter(paramPosition, jdbcType, outParam.scale); } else if (outParam.isSetTypeName()) { cstmt.registerOutParameter(paramPosition, jdbcType, outParam.typeName); } else { cstmt.registerOutParameter(paramPosition, jdbcType); } } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, OutputParameter struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.type != null) { oprot.writeFieldBegin(TYPE_FIELD_DESC); oprot.writeI32(struct.type.getValue()); oprot.writeFieldEnd(); } if (struct.isSetScale()) { oprot.writeFieldBegin(SCALE_FIELD_DESC); oprot.writeI32(struct.scale); oprot.writeFieldEnd(); } if (struct.typeName != null) { if (struct.isSetTypeName()) { oprot.writeFieldBegin(TYPE_NAME_FIELD_DESC); oprot.writeString(struct.typeName); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
/** * {@inheritDoc} */ @Override public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException { OutputParameter outParam = new OutputParameter( Converters.getThriftSQLType(sqlType)).setScale(scale); getOutputParamsSet().put(parameterIndex, outParam); }
/** * {@inheritDoc} */ @Override public void registerOutParameter(int parameterIndex, int sqlType, String typeName) throws SQLException { OutputParameter outParam = new OutputParameter( Converters.getThriftSQLType(sqlType)).setTypeName(typeName); getOutputParamsSet().put(parameterIndex, outParam); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof OutputParameter) return this.equals((OutputParameter)that); return false; }
@Override public String toString() { StringBuilder sb = new StringBuilder("OutputParameter("); boolean first = true; sb.append("type:"); if (this.type == null) { sb.append("null"); } else { sb.append(this.type); } first = false; if (isSetScale()) { if (!first) sb.append(", "); sb.append("scale:"); sb.append(this.scale); first = false; } if (isSetTypeName()) { if (!first) sb.append(", "); sb.append("typeName:"); if (this.typeName == null) { sb.append("null"); } else { sb.append(this.typeName); } first = false; } sb.append(")"); return sb.toString(); }
public boolean equals(OutputParameter that) { if (that == null) return false; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); if (this_present_type || that_present_type) { if (!(this_present_type && that_present_type)) return false; if (!this.type.equals(that.type)) return false; } boolean this_present_scale = true && this.isSetScale(); boolean that_present_scale = true && that.isSetScale(); if (this_present_scale || that_present_scale) { if (!(this_present_scale && that_present_scale)) return false; if (this.scale != that.scale) return false; } boolean this_present_typeName = true && this.isSetTypeName(); boolean that_present_typeName = true && that.isSetTypeName(); if (this_present_typeName || that_present_typeName) { if (!(this_present_typeName && that_present_typeName)) return false; if (!this.typeName.equals(that.typeName)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, OutputParameter struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.type.getValue()); BitSet optionals = new BitSet(); if (struct.isSetScale()) { optionals.set(0); } if (struct.isSetTypeName()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetScale()) { oprot.writeI32(struct.scale); } if (struct.isSetTypeName()) { oprot.writeString(struct.typeName); } }
/** * {@inheritDoc} */ @Override public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException { OutputParameter outParam = new OutputParameter( Converters.getThriftSQLType(sqlType)); getOutputParamsSet().put(parameterIndex, outParam); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_type = true && (isSetType()); list.add(present_type); if (present_type) list.add(type.getValue()); boolean present_scale = true && (isSetScale()); list.add(present_scale); if (present_scale) list.add(scale); boolean present_typeName = true && (isSetTypeName()); list.add(present_typeName); if (present_typeName) list.add(typeName); return list.hashCode(); }
lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; if (isSetType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetScale()).compareTo(other.isSetScale()); if (lastComparison != 0) { return lastComparison; if (isSetScale()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scale, other.scale); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetTypeName()).compareTo(other.isSetTypeName()); if (lastComparison != 0) { return lastComparison; if (isSetTypeName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeName, other.typeName); if (lastComparison != 0) {