com.databricks.jdbc.client.impl.thrift.generated.TDBSqlTempView Maven / Gradle / Ivy
/**
* Autogenerated by Thrift Compiler (0.19.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*
* @generated
*/
package com.databricks.jdbc.client.impl.thrift.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(
value = "Autogenerated by Thrift Compiler (0.19.0)",
date = "2024-05-06")
public class TDBSqlTempView
implements org.apache.thrift.TBase,
java.io.Serializable,
Cloneable,
Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC =
new org.apache.thrift.protocol.TStruct("TDBSqlTempView");
private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"name", org.apache.thrift.protocol.TType.STRING, (short) 1);
private static final org.apache.thrift.protocol.TField SQL_STATEMENT_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"sqlStatement", org.apache.thrift.protocol.TType.STRING, (short) 2);
private static final org.apache.thrift.protocol.TField PROPERTIES_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"properties", org.apache.thrift.protocol.TType.MAP, (short) 3);
private static final org.apache.thrift.protocol.TField VIEW_SCHEMA_FIELD_DESC =
new org.apache.thrift.protocol.TField(
"viewSchema", org.apache.thrift.protocol.TType.STRING, (short) 4);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY =
new TDBSqlTempViewStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY =
new TDBSqlTempViewTupleSchemeFactory();
public @org.apache.thrift.annotation.Nullable java.lang.String name; // optional
public @org.apache.thrift.annotation.Nullable java.lang.String sqlStatement; // optional
public @org.apache.thrift.annotation.Nullable java.util.Map
properties; // optional
public @org.apache.thrift.annotation.Nullable java.lang.String viewSchema; // optional
/**
* The set of fields this struct contains, along with convenience methods for finding and
* manipulating them.
*/
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
NAME((short) 1, "name"),
SQL_STATEMENT((short) 2, "sqlStatement"),
PROPERTIES((short) 3, "properties"),
VIEW_SCHEMA((short) 4, "viewSchema");
private static final java.util.Map byName =
new java.util.HashMap();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/** Find the _Fields constant that matches fieldId, or null if its not found. */
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch (fieldId) {
case 1: // NAME
return NAME;
case 2: // SQL_STATEMENT
return SQL_STATEMENT;
case 3: // PROPERTIES
return PROPERTIES;
case 4: // VIEW_SCHEMA
return VIEW_SCHEMA;
default:
return null;
}
}
/** Find the _Fields constant that matches fieldId, throwing an exception if it is not found. */
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null)
throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/** Find the _Fields constant that matches name, or null if its not found. */
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
@Override
public short getThriftFieldId() {
return _thriftId;
}
@Override
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final _Fields optionals[] = {
_Fields.NAME, _Fields.SQL_STATEMENT, _Fields.PROPERTIES, _Fields.VIEW_SCHEMA
};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap =
new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(
_Fields.NAME,
new org.apache.thrift.meta_data.FieldMetaData(
"name",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(
_Fields.SQL_STATEMENT,
new org.apache.thrift.meta_data.FieldMetaData(
"sqlStatement",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(
_Fields.PROPERTIES,
new org.apache.thrift.meta_data.FieldMetaData(
"properties",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.MapMetaData(
org.apache.thrift.protocol.TType.MAP,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING),
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING))));
tmpMap.put(
_Fields.VIEW_SCHEMA,
new org.apache.thrift.meta_data.FieldMetaData(
"viewSchema",
org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(
org.apache.thrift.protocol.TType.STRING)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(
TDBSqlTempView.class, metaDataMap);
}
public TDBSqlTempView() {}
/** Performs a deep copy on other. */
public TDBSqlTempView(TDBSqlTempView other) {
if (other.isSetName()) {
this.name = other.name;
}
if (other.isSetSqlStatement()) {
this.sqlStatement = other.sqlStatement;
}
if (other.isSetProperties()) {
java.util.Map __this__properties =
new java.util.HashMap(other.properties);
this.properties = __this__properties;
}
if (other.isSetViewSchema()) {
this.viewSchema = other.viewSchema;
}
}
@Override
public TDBSqlTempView deepCopy() {
return new TDBSqlTempView(this);
}
@Override
public void clear() {
this.name = null;
this.sqlStatement = null;
this.properties = null;
this.viewSchema = null;
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getName() {
return this.name;
}
public TDBSqlTempView setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
this.name = name;
return this;
}
public void unsetName() {
this.name = null;
}
/** Returns true if field name is set (has been assigned a value) and false otherwise */
public boolean isSetName() {
return this.name != null;
}
public void setNameIsSet(boolean value) {
if (!value) {
this.name = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getSqlStatement() {
return this.sqlStatement;
}
public TDBSqlTempView setSqlStatement(
@org.apache.thrift.annotation.Nullable java.lang.String sqlStatement) {
this.sqlStatement = sqlStatement;
return this;
}
public void unsetSqlStatement() {
this.sqlStatement = null;
}
/** Returns true if field sqlStatement is set (has been assigned a value) and false otherwise */
public boolean isSetSqlStatement() {
return this.sqlStatement != null;
}
public void setSqlStatementIsSet(boolean value) {
if (!value) {
this.sqlStatement = null;
}
}
public int getPropertiesSize() {
return (this.properties == null) ? 0 : this.properties.size();
}
public void putToProperties(java.lang.String key, java.lang.String val) {
if (this.properties == null) {
this.properties = new java.util.HashMap();
}
this.properties.put(key, val);
}
@org.apache.thrift.annotation.Nullable
public java.util.Map getProperties() {
return this.properties;
}
public TDBSqlTempView setProperties(
@org.apache.thrift.annotation.Nullable
java.util.Map properties) {
this.properties = properties;
return this;
}
public void unsetProperties() {
this.properties = null;
}
/** Returns true if field properties is set (has been assigned a value) and false otherwise */
public boolean isSetProperties() {
return this.properties != null;
}
public void setPropertiesIsSet(boolean value) {
if (!value) {
this.properties = null;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getViewSchema() {
return this.viewSchema;
}
public TDBSqlTempView setViewSchema(
@org.apache.thrift.annotation.Nullable java.lang.String viewSchema) {
this.viewSchema = viewSchema;
return this;
}
public void unsetViewSchema() {
this.viewSchema = null;
}
/** Returns true if field viewSchema is set (has been assigned a value) and false otherwise */
public boolean isSetViewSchema() {
return this.viewSchema != null;
}
public void setViewSchemaIsSet(boolean value) {
if (!value) {
this.viewSchema = null;
}
}
@Override
public void setFieldValue(
_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case NAME:
if (value == null) {
unsetName();
} else {
setName((java.lang.String) value);
}
break;
case SQL_STATEMENT:
if (value == null) {
unsetSqlStatement();
} else {
setSqlStatement((java.lang.String) value);
}
break;
case PROPERTIES:
if (value == null) {
unsetProperties();
} else {
setProperties((java.util.Map) value);
}
break;
case VIEW_SCHEMA:
if (value == null) {
unsetViewSchema();
} else {
setViewSchema((java.lang.String) value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
@Override
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case NAME:
return getName();
case SQL_STATEMENT:
return getSqlStatement();
case PROPERTIES:
return getProperties();
case VIEW_SCHEMA:
return getViewSchema();
}
throw new java.lang.IllegalStateException();
}
/**
* Returns true if field corresponding to fieldID is set (has been assigned a value) and false
* otherwise
*/
@Override
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case NAME:
return isSetName();
case SQL_STATEMENT:
return isSetSqlStatement();
case PROPERTIES:
return isSetProperties();
case VIEW_SCHEMA:
return isSetViewSchema();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof TDBSqlTempView) return this.equals((TDBSqlTempView) that);
return false;
}
public boolean equals(TDBSqlTempView that) {
if (that == null) return false;
if (this == that) return true;
boolean this_present_name = true && this.isSetName();
boolean that_present_name = true && that.isSetName();
if (this_present_name || that_present_name) {
if (!(this_present_name && that_present_name)) return false;
if (!this.name.equals(that.name)) return false;
}
boolean this_present_sqlStatement = true && this.isSetSqlStatement();
boolean that_present_sqlStatement = true && that.isSetSqlStatement();
if (this_present_sqlStatement || that_present_sqlStatement) {
if (!(this_present_sqlStatement && that_present_sqlStatement)) return false;
if (!this.sqlStatement.equals(that.sqlStatement)) return false;
}
boolean this_present_properties = true && this.isSetProperties();
boolean that_present_properties = true && that.isSetProperties();
if (this_present_properties || that_present_properties) {
if (!(this_present_properties && that_present_properties)) return false;
if (!this.properties.equals(that.properties)) return false;
}
boolean this_present_viewSchema = true && this.isSetViewSchema();
boolean that_present_viewSchema = true && that.isSetViewSchema();
if (this_present_viewSchema || that_present_viewSchema) {
if (!(this_present_viewSchema && that_present_viewSchema)) return false;
if (!this.viewSchema.equals(that.viewSchema)) return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
if (isSetName()) hashCode = hashCode * 8191 + name.hashCode();
hashCode = hashCode * 8191 + ((isSetSqlStatement()) ? 131071 : 524287);
if (isSetSqlStatement()) hashCode = hashCode * 8191 + sqlStatement.hashCode();
hashCode = hashCode * 8191 + ((isSetProperties()) ? 131071 : 524287);
if (isSetProperties()) hashCode = hashCode * 8191 + properties.hashCode();
hashCode = hashCode * 8191 + ((isSetViewSchema()) ? 131071 : 524287);
if (isSetViewSchema()) hashCode = hashCode * 8191 + viewSchema.hashCode();
return hashCode;
}
@Override
public int compareTo(TDBSqlTempView other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetName()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetSqlStatement(), other.isSetSqlStatement());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSqlStatement()) {
lastComparison =
org.apache.thrift.TBaseHelper.compareTo(this.sqlStatement, other.sqlStatement);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetProperties(), other.isSetProperties());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetProperties()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.properties, other.properties);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetViewSchema(), other.isSetViewSchema());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetViewSchema()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.viewSchema, other.viewSchema);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
@Override
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot)
throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("TDBSqlTempView(");
boolean first = true;
if (isSetName()) {
sb.append("name:");
if (this.name == null) {
sb.append("null");
} else {
sb.append(this.name);
}
first = false;
}
if (isSetSqlStatement()) {
if (!first) sb.append(", ");
sb.append("sqlStatement:");
if (this.sqlStatement == null) {
sb.append("null");
} else {
sb.append(this.sqlStatement);
}
first = false;
}
if (isSetProperties()) {
if (!first) sb.append(", ");
sb.append("properties:");
if (this.properties == null) {
sb.append("null");
} else {
sb.append(this.properties);
}
first = false;
}
if (isSetViewSchema()) {
if (!first) sb.append(", ");
sb.append("viewSchema:");
if (this.viewSchema == null) {
sb.append("null");
} else {
sb.append(this.viewSchema);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(
new org.apache.thrift.protocol.TCompactProtocol(
new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(
new org.apache.thrift.protocol.TCompactProtocol(
new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class TDBSqlTempViewStandardSchemeFactory
implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TDBSqlTempViewStandardScheme getScheme() {
return new TDBSqlTempViewStandardScheme();
}
}
private static class TDBSqlTempViewStandardScheme
extends org.apache.thrift.scheme.StandardScheme {
@Override
public void read(org.apache.thrift.protocol.TProtocol iprot, TDBSqlTempView struct)
throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true) {
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // NAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // SQL_STATEMENT
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.sqlStatement = iprot.readString();
struct.setSqlStatementIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // PROPERTIES
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
org.apache.thrift.protocol.TMap _map170 = iprot.readMapBegin();
struct.properties =
new java.util.HashMap(2 * _map170.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key171;
@org.apache.thrift.annotation.Nullable java.lang.String _val172;
for (int _i173 = 0; _i173 < _map170.size; ++_i173) {
_key171 = iprot.readString();
_val172 = iprot.readString();
struct.properties.put(_key171, _val172);
}
iprot.readMapEnd();
}
struct.setPropertiesIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // VIEW_SCHEMA
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.viewSchema = iprot.readString();
struct.setViewSchemaIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
@Override
public void write(org.apache.thrift.protocol.TProtocol oprot, TDBSqlTempView struct)
throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.name != null) {
if (struct.isSetName()) {
oprot.writeFieldBegin(NAME_FIELD_DESC);
oprot.writeString(struct.name);
oprot.writeFieldEnd();
}
}
if (struct.sqlStatement != null) {
if (struct.isSetSqlStatement()) {
oprot.writeFieldBegin(SQL_STATEMENT_FIELD_DESC);
oprot.writeString(struct.sqlStatement);
oprot.writeFieldEnd();
}
}
if (struct.properties != null) {
if (struct.isSetProperties()) {
oprot.writeFieldBegin(PROPERTIES_FIELD_DESC);
{
oprot.writeMapBegin(
new org.apache.thrift.protocol.TMap(
org.apache.thrift.protocol.TType.STRING,
org.apache.thrift.protocol.TType.STRING,
struct.properties.size()));
for (java.util.Map.Entry _iter174 :
struct.properties.entrySet()) {
oprot.writeString(_iter174.getKey());
oprot.writeString(_iter174.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
}
if (struct.viewSchema != null) {
if (struct.isSetViewSchema()) {
oprot.writeFieldBegin(VIEW_SCHEMA_FIELD_DESC);
oprot.writeString(struct.viewSchema);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class TDBSqlTempViewTupleSchemeFactory
implements org.apache.thrift.scheme.SchemeFactory {
@Override
public TDBSqlTempViewTupleScheme getScheme() {
return new TDBSqlTempViewTupleScheme();
}
}
private static class TDBSqlTempViewTupleScheme
extends org.apache.thrift.scheme.TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, TDBSqlTempView struct)
throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot =
(org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetName()) {
optionals.set(0);
}
if (struct.isSetSqlStatement()) {
optionals.set(1);
}
if (struct.isSetProperties()) {
optionals.set(2);
}
if (struct.isSetViewSchema()) {
optionals.set(3);
}
oprot.writeBitSet(optionals, 4);
if (struct.isSetName()) {
oprot.writeString(struct.name);
}
if (struct.isSetSqlStatement()) {
oprot.writeString(struct.sqlStatement);
}
if (struct.isSetProperties()) {
{
oprot.writeI32(struct.properties.size());
for (java.util.Map.Entry _iter175 :
struct.properties.entrySet()) {
oprot.writeString(_iter175.getKey());
oprot.writeString(_iter175.getValue());
}
}
}
if (struct.isSetViewSchema()) {
oprot.writeString(struct.viewSchema);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TDBSqlTempView struct)
throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot =
(org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(4);
if (incoming.get(0)) {
struct.name = iprot.readString();
struct.setNameIsSet(true);
}
if (incoming.get(1)) {
struct.sqlStatement = iprot.readString();
struct.setSqlStatementIsSet(true);
}
if (incoming.get(2)) {
{
org.apache.thrift.protocol.TMap _map176 =
iprot.readMapBegin(
org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING);
struct.properties =
new java.util.HashMap(2 * _map176.size);
@org.apache.thrift.annotation.Nullable java.lang.String _key177;
@org.apache.thrift.annotation.Nullable java.lang.String _val178;
for (int _i179 = 0; _i179 < _map176.size; ++_i179) {
_key177 = iprot.readString();
_val178 = iprot.readString();
struct.properties.put(_key177, _val178);
}
}
struct.setPropertiesIsSet(true);
}
if (incoming.get(3)) {
struct.viewSchema = iprot.readString();
struct.setViewSchemaIsSet(true);
}
}
}
private static S scheme(
org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme())
? STANDARD_SCHEME_FACTORY
: TUPLE_SCHEME_FACTORY)
.getScheme();
}
}