/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package org.apache.cassandra.thrift; /* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.thrift.*; import org.apache.thrift.async.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.transport.*; import org.apache.thrift.protocol.*; public class CfDef implements TBase<CfDef, CfDef._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("CfDef"); private static final TField KEYSPACE_FIELD_DESC = new TField("keyspace", TType.STRING, (short)1); private static final TField NAME_FIELD_DESC = new TField("name", TType.STRING, (short)2); private static final TField COLUMN_TYPE_FIELD_DESC = new TField("column_type", TType.STRING, (short)3); private static final TField CLOCK_TYPE_FIELD_DESC = new TField("clock_type", TType.STRING, (short)4); private static final TField COMPARATOR_TYPE_FIELD_DESC = new TField("comparator_type", TType.STRING, (short)5); private static final TField SUBCOMPARATOR_TYPE_FIELD_DESC = new TField("subcomparator_type", TType.STRING, (short)6); private static final TField RECONCILER_FIELD_DESC = new TField("reconciler", TType.STRING, (short)7); private static final TField COMMENT_FIELD_DESC = new TField("comment", TType.STRING, (short)8); private static final TField ROW_CACHE_SIZE_FIELD_DESC = new TField("row_cache_size", TType.DOUBLE, (short)9); private static final TField PRELOAD_ROW_CACHE_FIELD_DESC = new TField("preload_row_cache", TType.BOOL, (short)10); private static final TField KEY_CACHE_SIZE_FIELD_DESC = new TField("key_cache_size", TType.DOUBLE, (short)11); private static final TField READ_REPAIR_CHANCE_FIELD_DESC = new TField("read_repair_chance", TType.DOUBLE, (short)12); private static final TField COLUMN_METADATA_FIELD_DESC = new TField("column_metadata", TType.LIST, (short)13); private static final TField GC_GRACE_SECONDS_FIELD_DESC = new TField("gc_grace_seconds", TType.I32, (short)14); private static final TField DEFAULT_VALIDATION_CLASS_FIELD_DESC = new TField("default_validation_class", TType.STRING, (short)15); private static final TField ID_FIELD_DESC = new TField("id", TType.I32, (short)16); public String keyspace; public String name; public String column_type; public String clock_type; public String comparator_type; public String subcomparator_type; public String reconciler; public String comment; public double row_cache_size; public boolean preload_row_cache; public double key_cache_size; public double read_repair_chance; public List<ColumnDef> column_metadata; public int gc_grace_seconds; public String default_validation_class; public int id; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { KEYSPACE((short)1, "keyspace"), NAME((short)2, "name"), COLUMN_TYPE((short)3, "column_type"), CLOCK_TYPE((short)4, "clock_type"), COMPARATOR_TYPE((short)5, "comparator_type"), SUBCOMPARATOR_TYPE((short)6, "subcomparator_type"), RECONCILER((short)7, "reconciler"), COMMENT((short)8, "comment"), ROW_CACHE_SIZE((short)9, "row_cache_size"), PRELOAD_ROW_CACHE((short)10, "preload_row_cache"), KEY_CACHE_SIZE((short)11, "key_cache_size"), READ_REPAIR_CHANCE((short)12, "read_repair_chance"), COLUMN_METADATA((short)13, "column_metadata"), GC_GRACE_SECONDS((short)14, "gc_grace_seconds"), DEFAULT_VALIDATION_CLASS((short)15, "default_validation_class"), ID((short)16, "id"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // KEYSPACE return KEYSPACE; case 2: // NAME return NAME; case 3: // COLUMN_TYPE return COLUMN_TYPE; case 4: // CLOCK_TYPE return CLOCK_TYPE; case 5: // COMPARATOR_TYPE return COMPARATOR_TYPE; case 6: // SUBCOMPARATOR_TYPE return SUBCOMPARATOR_TYPE; case 7: // RECONCILER return RECONCILER; case 8: // COMMENT return COMMENT; case 9: // ROW_CACHE_SIZE return ROW_CACHE_SIZE; case 10: // PRELOAD_ROW_CACHE return PRELOAD_ROW_CACHE; case 11: // KEY_CACHE_SIZE return KEY_CACHE_SIZE; case 12: // READ_REPAIR_CHANCE return READ_REPAIR_CHANCE; case 13: // COLUMN_METADATA return COLUMN_METADATA; case 14: // GC_GRACE_SECONDS return GC_GRACE_SECONDS; case 15: // DEFAULT_VALIDATION_CLASS return DEFAULT_VALIDATION_CLASS; case 16: // ID return ID; 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments private static final int __ROW_CACHE_SIZE_ISSET_ID = 0; private static final int __PRELOAD_ROW_CACHE_ISSET_ID = 1; private static final int __KEY_CACHE_SIZE_ISSET_ID = 2; private static final int __READ_REPAIR_CHANCE_ISSET_ID = 3; private static final int __GC_GRACE_SECONDS_ISSET_ID = 4; private static final int __ID_ISSET_ID = 5; private BitSet __isset_bit_vector = new BitSet(6); public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.KEYSPACE, new FieldMetaData("keyspace", TFieldRequirementType.REQUIRED, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.NAME, new FieldMetaData("name", TFieldRequirementType.REQUIRED, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.COLUMN_TYPE, new FieldMetaData("column_type", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.CLOCK_TYPE, new FieldMetaData("clock_type", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.COMPARATOR_TYPE, new FieldMetaData("comparator_type", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.SUBCOMPARATOR_TYPE, new FieldMetaData("subcomparator_type", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.RECONCILER, new FieldMetaData("reconciler", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.COMMENT, new FieldMetaData("comment", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.ROW_CACHE_SIZE, new FieldMetaData("row_cache_size", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.DOUBLE))); tmpMap.put(_Fields.PRELOAD_ROW_CACHE, new FieldMetaData("preload_row_cache", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.BOOL))); tmpMap.put(_Fields.KEY_CACHE_SIZE, new FieldMetaData("key_cache_size", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.DOUBLE))); tmpMap.put(_Fields.READ_REPAIR_CHANCE, new FieldMetaData("read_repair_chance", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.DOUBLE))); tmpMap.put(_Fields.COLUMN_METADATA, new FieldMetaData("column_metadata", TFieldRequirementType.OPTIONAL, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, ColumnDef.class)))); tmpMap.put(_Fields.GC_GRACE_SECONDS, new FieldMetaData("gc_grace_seconds", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.I32))); tmpMap.put(_Fields.DEFAULT_VALIDATION_CLASS, new FieldMetaData("default_validation_class", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.ID, new FieldMetaData("id", TFieldRequirementType.OPTIONAL, new FieldValueMetaData(TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(CfDef.class, metaDataMap); } public CfDef() { this.column_type = "Standard"; this.clock_type = "Timestamp"; this.comparator_type = "BytesType"; this.row_cache_size = (double)0; this.preload_row_cache = false; this.key_cache_size = (double)200000; this.read_repair_chance = 1; } public CfDef( String keyspace, String name) { this(); this.keyspace = keyspace; this.name = name; } /** * Performs a deep copy on <i>other</i>. */ public CfDef(CfDef other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.isSetKeyspace()) { this.keyspace = other.keyspace; } if (other.isSetName()) { this.name = other.name; } if (other.isSetColumn_type()) { this.column_type = other.column_type; } if (other.isSetClock_type()) { this.clock_type = other.clock_type; } if (other.isSetComparator_type()) { this.comparator_type = other.comparator_type; } if (other.isSetSubcomparator_type()) { this.subcomparator_type = other.subcomparator_type; } if (other.isSetReconciler()) { this.reconciler = other.reconciler; } if (other.isSetComment()) { this.comment = other.comment; } this.row_cache_size = other.row_cache_size; this.preload_row_cache = other.preload_row_cache; this.key_cache_size = other.key_cache_size; this.read_repair_chance = other.read_repair_chance; if (other.isSetColumn_metadata()) { List<ColumnDef> __this__column_metadata = new ArrayList<ColumnDef>(); for (ColumnDef other_element : other.column_metadata) { __this__column_metadata.add(new ColumnDef(other_element)); } this.column_metadata = __this__column_metadata; } this.gc_grace_seconds = other.gc_grace_seconds; if (other.isSetDefault_validation_class()) { this.default_validation_class = other.default_validation_class; } this.id = other.id; } public CfDef deepCopy() { return new CfDef(this); } @Deprecated public CfDef clone() { return new CfDef(this); } public String getKeyspace() { return this.keyspace; } public CfDef setKeyspace(String keyspace) { this.keyspace = keyspace; return this; } public void unsetKeyspace() { this.keyspace = null; } /** Returns true if field keyspace is set (has been asigned a value) and false otherwise */ public boolean isSetKeyspace() { return this.keyspace != null; } public void setKeyspaceIsSet(boolean value) { if (!value) { this.keyspace = null; } } public String getName() { return this.name; } public CfDef setName(String name) { this.name = name; return this; } public void unsetName() { this.name = null; } /** Returns true if field name is set (has been asigned a value) and false otherwise */ public boolean isSetName() { return this.name != null; } public void setNameIsSet(boolean value) { if (!value) { this.name = null; } } public String getColumn_type() { return this.column_type; } public CfDef setColumn_type(String column_type) { this.column_type = column_type; return this; } public void unsetColumn_type() { this.column_type = null; } /** Returns true if field column_type is set (has been asigned a value) and false otherwise */ public boolean isSetColumn_type() { return this.column_type != null; } public void setColumn_typeIsSet(boolean value) { if (!value) { this.column_type = null; } } public String getClock_type() { return this.clock_type; } public CfDef setClock_type(String clock_type) { this.clock_type = clock_type; return this; } public void unsetClock_type() { this.clock_type = null; } /** Returns true if field clock_type is set (has been asigned a value) and false otherwise */ public boolean isSetClock_type() { return this.clock_type != null; } public void setClock_typeIsSet(boolean value) { if (!value) { this.clock_type = null; } } public String getComparator_type() { return this.comparator_type; } public CfDef setComparator_type(String comparator_type) { this.comparator_type = comparator_type; return this; } public void unsetComparator_type() { this.comparator_type = null; } /** Returns true if field comparator_type is set (has been asigned a value) and false otherwise */ public boolean isSetComparator_type() { return this.comparator_type != null; } public void setComparator_typeIsSet(boolean value) { if (!value) { this.comparator_type = null; } } public String getSubcomparator_type() { return this.subcomparator_type; } public CfDef setSubcomparator_type(String subcomparator_type) { this.subcomparator_type = subcomparator_type; return this; } public void unsetSubcomparator_type() { this.subcomparator_type = null; } /** Returns true if field subcomparator_type is set (has been asigned a value) and false otherwise */ public boolean isSetSubcomparator_type() { return this.subcomparator_type != null; } public void setSubcomparator_typeIsSet(boolean value) { if (!value) { this.subcomparator_type = null; } } public String getReconciler() { return this.reconciler; } public CfDef setReconciler(String reconciler) { this.reconciler = reconciler; return this; } public void unsetReconciler() { this.reconciler = null; } /** Returns true if field reconciler is set (has been asigned a value) and false otherwise */ public boolean isSetReconciler() { return this.reconciler != null; } public void setReconcilerIsSet(boolean value) { if (!value) { this.reconciler = null; } } public String getComment() { return this.comment; } public CfDef setComment(String comment) { this.comment = comment; return this; } public void unsetComment() { this.comment = null; } /** Returns true if field comment is set (has been asigned a value) and false otherwise */ public boolean isSetComment() { return this.comment != null; } public void setCommentIsSet(boolean value) { if (!value) { this.comment = null; } } public double getRow_cache_size() { return this.row_cache_size; } public CfDef setRow_cache_size(double row_cache_size) { this.row_cache_size = row_cache_size; setRow_cache_sizeIsSet(true); return this; } public void unsetRow_cache_size() { __isset_bit_vector.clear(__ROW_CACHE_SIZE_ISSET_ID); } /** Returns true if field row_cache_size is set (has been asigned a value) and false otherwise */ public boolean isSetRow_cache_size() { return __isset_bit_vector.get(__ROW_CACHE_SIZE_ISSET_ID); } public void setRow_cache_sizeIsSet(boolean value) { __isset_bit_vector.set(__ROW_CACHE_SIZE_ISSET_ID, value); } public boolean isPreload_row_cache() { return this.preload_row_cache; } public CfDef setPreload_row_cache(boolean preload_row_cache) { this.preload_row_cache = preload_row_cache; setPreload_row_cacheIsSet(true); return this; } public void unsetPreload_row_cache() { __isset_bit_vector.clear(__PRELOAD_ROW_CACHE_ISSET_ID); } /** Returns true if field preload_row_cache is set (has been asigned a value) and false otherwise */ public boolean isSetPreload_row_cache() { return __isset_bit_vector.get(__PRELOAD_ROW_CACHE_ISSET_ID); } public void setPreload_row_cacheIsSet(boolean value) { __isset_bit_vector.set(__PRELOAD_ROW_CACHE_ISSET_ID, value); } public double getKey_cache_size() { return this.key_cache_size; } public CfDef setKey_cache_size(double key_cache_size) { this.key_cache_size = key_cache_size; setKey_cache_sizeIsSet(true); return this; } public void unsetKey_cache_size() { __isset_bit_vector.clear(__KEY_CACHE_SIZE_ISSET_ID); } /** Returns true if field key_cache_size is set (has been asigned a value) and false otherwise */ public boolean isSetKey_cache_size() { return __isset_bit_vector.get(__KEY_CACHE_SIZE_ISSET_ID); } public void setKey_cache_sizeIsSet(boolean value) { __isset_bit_vector.set(__KEY_CACHE_SIZE_ISSET_ID, value); } public double getRead_repair_chance() { return this.read_repair_chance; } public CfDef setRead_repair_chance(double read_repair_chance) { this.read_repair_chance = read_repair_chance; setRead_repair_chanceIsSet(true); return this; } public void unsetRead_repair_chance() { __isset_bit_vector.clear(__READ_REPAIR_CHANCE_ISSET_ID); } /** Returns true if field read_repair_chance is set (has been asigned a value) and false otherwise */ public boolean isSetRead_repair_chance() { return __isset_bit_vector.get(__READ_REPAIR_CHANCE_ISSET_ID); } public void setRead_repair_chanceIsSet(boolean value) { __isset_bit_vector.set(__READ_REPAIR_CHANCE_ISSET_ID, value); } public int getColumn_metadataSize() { return (this.column_metadata == null) ? 0 : this.column_metadata.size(); } public java.util.Iterator<ColumnDef> getColumn_metadataIterator() { return (this.column_metadata == null) ? null : this.column_metadata.iterator(); } public void addToColumn_metadata(ColumnDef elem) { if (this.column_metadata == null) { this.column_metadata = new ArrayList<ColumnDef>(); } this.column_metadata.add(elem); } public List<ColumnDef> getColumn_metadata() { return this.column_metadata; } public CfDef setColumn_metadata(List<ColumnDef> column_metadata) { this.column_metadata = column_metadata; return this; } public void unsetColumn_metadata() { this.column_metadata = null; } /** Returns true if field column_metadata is set (has been asigned a value) and false otherwise */ public boolean isSetColumn_metadata() { return this.column_metadata != null; } public void setColumn_metadataIsSet(boolean value) { if (!value) { this.column_metadata = null; } } public int getGc_grace_seconds() { return this.gc_grace_seconds; } public CfDef setGc_grace_seconds(int gc_grace_seconds) { this.gc_grace_seconds = gc_grace_seconds; setGc_grace_secondsIsSet(true); return this; } public void unsetGc_grace_seconds() { __isset_bit_vector.clear(__GC_GRACE_SECONDS_ISSET_ID); } /** Returns true if field gc_grace_seconds is set (has been asigned a value) and false otherwise */ public boolean isSetGc_grace_seconds() { return __isset_bit_vector.get(__GC_GRACE_SECONDS_ISSET_ID); } public void setGc_grace_secondsIsSet(boolean value) { __isset_bit_vector.set(__GC_GRACE_SECONDS_ISSET_ID, value); } public String getDefault_validation_class() { return this.default_validation_class; } public CfDef setDefault_validation_class(String default_validation_class) { this.default_validation_class = default_validation_class; return this; } public void unsetDefault_validation_class() { this.default_validation_class = null; } /** Returns true if field default_validation_class is set (has been asigned a value) and false otherwise */ public boolean isSetDefault_validation_class() { return this.default_validation_class != null; } public void setDefault_validation_classIsSet(boolean value) { if (!value) { this.default_validation_class = null; } } public int getId() { return this.id; } public CfDef setId(int id) { this.id = id; setIdIsSet(true); return this; } public void unsetId() { __isset_bit_vector.clear(__ID_ISSET_ID); } /** Returns true if field id is set (has been asigned a value) and false otherwise */ public boolean isSetId() { return __isset_bit_vector.get(__ID_ISSET_ID); } public void setIdIsSet(boolean value) { __isset_bit_vector.set(__ID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case KEYSPACE: if (value == null) { unsetKeyspace(); } else { setKeyspace((String)value); } break; case NAME: if (value == null) { unsetName(); } else { setName((String)value); } break; case COLUMN_TYPE: if (value == null) { unsetColumn_type(); } else { setColumn_type((String)value); } break; case CLOCK_TYPE: if (value == null) { unsetClock_type(); } else { setClock_type((String)value); } break; case COMPARATOR_TYPE: if (value == null) { unsetComparator_type(); } else { setComparator_type((String)value); } break; case SUBCOMPARATOR_TYPE: if (value == null) { unsetSubcomparator_type(); } else { setSubcomparator_type((String)value); } break; case RECONCILER: if (value == null) { unsetReconciler(); } else { setReconciler((String)value); } break; case COMMENT: if (value == null) { unsetComment(); } else { setComment((String)value); } break; case ROW_CACHE_SIZE: if (value == null) { unsetRow_cache_size(); } else { setRow_cache_size((Double)value); } break; case PRELOAD_ROW_CACHE: if (value == null) { unsetPreload_row_cache(); } else { setPreload_row_cache((Boolean)value); } break; case KEY_CACHE_SIZE: if (value == null) { unsetKey_cache_size(); } else { setKey_cache_size((Double)value); } break; case READ_REPAIR_CHANCE: if (value == null) { unsetRead_repair_chance(); } else { setRead_repair_chance((Double)value); } break; case COLUMN_METADATA: if (value == null) { unsetColumn_metadata(); } else { setColumn_metadata((List<ColumnDef>)value); } break; case GC_GRACE_SECONDS: if (value == null) { unsetGc_grace_seconds(); } else { setGc_grace_seconds((Integer)value); } break; case DEFAULT_VALIDATION_CLASS: if (value == null) { unsetDefault_validation_class(); } else { setDefault_validation_class((String)value); } break; case ID: if (value == null) { unsetId(); } else { setId((Integer)value); } break; } } public void setFieldValue(int fieldID, Object value) { setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); } public Object getFieldValue(_Fields field) { switch (field) { case KEYSPACE: return getKeyspace(); case NAME: return getName(); case COLUMN_TYPE: return getColumn_type(); case CLOCK_TYPE: return getClock_type(); case COMPARATOR_TYPE: return getComparator_type(); case SUBCOMPARATOR_TYPE: return getSubcomparator_type(); case RECONCILER: return getReconciler(); case COMMENT: return getComment(); case ROW_CACHE_SIZE: return new Double(getRow_cache_size()); case PRELOAD_ROW_CACHE: return new Boolean(isPreload_row_cache()); case KEY_CACHE_SIZE: return new Double(getKey_cache_size()); case READ_REPAIR_CHANCE: return new Double(getRead_repair_chance()); case COLUMN_METADATA: return getColumn_metadata(); case GC_GRACE_SECONDS: return new Integer(getGc_grace_seconds()); case DEFAULT_VALIDATION_CLASS: return getDefault_validation_class(); case ID: return new Integer(getId()); } throw new IllegalStateException(); } public Object getFieldValue(int fieldId) { return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { switch (field) { case KEYSPACE: return isSetKeyspace(); case NAME: return isSetName(); case COLUMN_TYPE: return isSetColumn_type(); case CLOCK_TYPE: return isSetClock_type(); case COMPARATOR_TYPE: return isSetComparator_type(); case SUBCOMPARATOR_TYPE: return isSetSubcomparator_type(); case RECONCILER: return isSetReconciler(); case COMMENT: return isSetComment(); case ROW_CACHE_SIZE: return isSetRow_cache_size(); case PRELOAD_ROW_CACHE: return isSetPreload_row_cache(); case KEY_CACHE_SIZE: return isSetKey_cache_size(); case READ_REPAIR_CHANCE: return isSetRead_repair_chance(); case COLUMN_METADATA: return isSetColumn_metadata(); case GC_GRACE_SECONDS: return isSetGc_grace_seconds(); case DEFAULT_VALIDATION_CLASS: return isSetDefault_validation_class(); case ID: return isSetId(); } throw new IllegalStateException(); } public boolean isSet(int fieldID) { return isSet(_Fields.findByThriftIdOrThrow(fieldID)); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof CfDef) return this.equals((CfDef)that); return false; } public boolean equals(CfDef that) { if (that == null) return false; boolean this_present_keyspace = true && this.isSetKeyspace(); boolean that_present_keyspace = true && that.isSetKeyspace(); if (this_present_keyspace || that_present_keyspace) { if (!(this_present_keyspace && that_present_keyspace)) return false; if (!this.keyspace.equals(that.keyspace)) return false; } 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_column_type = true && this.isSetColumn_type(); boolean that_present_column_type = true && that.isSetColumn_type(); if (this_present_column_type || that_present_column_type) { if (!(this_present_column_type && that_present_column_type)) return false; if (!this.column_type.equals(that.column_type)) return false; } boolean this_present_clock_type = true && this.isSetClock_type(); boolean that_present_clock_type = true && that.isSetClock_type(); if (this_present_clock_type || that_present_clock_type) { if (!(this_present_clock_type && that_present_clock_type)) return false; if (!this.clock_type.equals(that.clock_type)) return false; } boolean this_present_comparator_type = true && this.isSetComparator_type(); boolean that_present_comparator_type = true && that.isSetComparator_type(); if (this_present_comparator_type || that_present_comparator_type) { if (!(this_present_comparator_type && that_present_comparator_type)) return false; if (!this.comparator_type.equals(that.comparator_type)) return false; } boolean this_present_subcomparator_type = true && this.isSetSubcomparator_type(); boolean that_present_subcomparator_type = true && that.isSetSubcomparator_type(); if (this_present_subcomparator_type || that_present_subcomparator_type) { if (!(this_present_subcomparator_type && that_present_subcomparator_type)) return false; if (!this.subcomparator_type.equals(that.subcomparator_type)) return false; } boolean this_present_reconciler = true && this.isSetReconciler(); boolean that_present_reconciler = true && that.isSetReconciler(); if (this_present_reconciler || that_present_reconciler) { if (!(this_present_reconciler && that_present_reconciler)) return false; if (!this.reconciler.equals(that.reconciler)) return false; } boolean this_present_comment = true && this.isSetComment(); boolean that_present_comment = true && that.isSetComment(); if (this_present_comment || that_present_comment) { if (!(this_present_comment && that_present_comment)) return false; if (!this.comment.equals(that.comment)) return false; } boolean this_present_row_cache_size = true && this.isSetRow_cache_size(); boolean that_present_row_cache_size = true && that.isSetRow_cache_size(); if (this_present_row_cache_size || that_present_row_cache_size) { if (!(this_present_row_cache_size && that_present_row_cache_size)) return false; if (this.row_cache_size != that.row_cache_size) return false; } boolean this_present_preload_row_cache = true && this.isSetPreload_row_cache(); boolean that_present_preload_row_cache = true && that.isSetPreload_row_cache(); if (this_present_preload_row_cache || that_present_preload_row_cache) { if (!(this_present_preload_row_cache && that_present_preload_row_cache)) return false; if (this.preload_row_cache != that.preload_row_cache) return false; } boolean this_present_key_cache_size = true && this.isSetKey_cache_size(); boolean that_present_key_cache_size = true && that.isSetKey_cache_size(); if (this_present_key_cache_size || that_present_key_cache_size) { if (!(this_present_key_cache_size && that_present_key_cache_size)) return false; if (this.key_cache_size != that.key_cache_size) return false; } boolean this_present_read_repair_chance = true && this.isSetRead_repair_chance(); boolean that_present_read_repair_chance = true && that.isSetRead_repair_chance(); if (this_present_read_repair_chance || that_present_read_repair_chance) { if (!(this_present_read_repair_chance && that_present_read_repair_chance)) return false; if (this.read_repair_chance != that.read_repair_chance) return false; } boolean this_present_column_metadata = true && this.isSetColumn_metadata(); boolean that_present_column_metadata = true && that.isSetColumn_metadata(); if (this_present_column_metadata || that_present_column_metadata) { if (!(this_present_column_metadata && that_present_column_metadata)) return false; if (!this.column_metadata.equals(that.column_metadata)) return false; } boolean this_present_gc_grace_seconds = true && this.isSetGc_grace_seconds(); boolean that_present_gc_grace_seconds = true && that.isSetGc_grace_seconds(); if (this_present_gc_grace_seconds || that_present_gc_grace_seconds) { if (!(this_present_gc_grace_seconds && that_present_gc_grace_seconds)) return false; if (this.gc_grace_seconds != that.gc_grace_seconds) return false; } boolean this_present_default_validation_class = true && this.isSetDefault_validation_class(); boolean that_present_default_validation_class = true && that.isSetDefault_validation_class(); if (this_present_default_validation_class || that_present_default_validation_class) { if (!(this_present_default_validation_class && that_present_default_validation_class)) return false; if (!this.default_validation_class.equals(that.default_validation_class)) return false; } boolean this_present_id = true && this.isSetId(); boolean that_present_id = true && that.isSetId(); if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(CfDef other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; CfDef typedOther = (CfDef)other; lastComparison = Boolean.valueOf(isSetKeyspace()).compareTo(typedOther.isSetKeyspace()); if (lastComparison != 0) { return lastComparison; } if (isSetKeyspace()) { lastComparison = TBaseHelper.compareTo(this.keyspace, typedOther.keyspace); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName()); if (lastComparison != 0) { return lastComparison; } if (isSetName()) { lastComparison = TBaseHelper.compareTo(this.name, typedOther.name); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetColumn_type()).compareTo(typedOther.isSetColumn_type()); if (lastComparison != 0) { return lastComparison; } if (isSetColumn_type()) { lastComparison = TBaseHelper.compareTo(this.column_type, typedOther.column_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetClock_type()).compareTo(typedOther.isSetClock_type()); if (lastComparison != 0) { return lastComparison; } if (isSetClock_type()) { lastComparison = TBaseHelper.compareTo(this.clock_type, typedOther.clock_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetComparator_type()).compareTo(typedOther.isSetComparator_type()); if (lastComparison != 0) { return lastComparison; } if (isSetComparator_type()) { lastComparison = TBaseHelper.compareTo(this.comparator_type, typedOther.comparator_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSubcomparator_type()).compareTo(typedOther.isSetSubcomparator_type()); if (lastComparison != 0) { return lastComparison; } if (isSetSubcomparator_type()) { lastComparison = TBaseHelper.compareTo(this.subcomparator_type, typedOther.subcomparator_type); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetReconciler()).compareTo(typedOther.isSetReconciler()); if (lastComparison != 0) { return lastComparison; } if (isSetReconciler()) { lastComparison = TBaseHelper.compareTo(this.reconciler, typedOther.reconciler); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetComment()).compareTo(typedOther.isSetComment()); if (lastComparison != 0) { return lastComparison; } if (isSetComment()) { lastComparison = TBaseHelper.compareTo(this.comment, typedOther.comment); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRow_cache_size()).compareTo(typedOther.isSetRow_cache_size()); if (lastComparison != 0) { return lastComparison; } if (isSetRow_cache_size()) { lastComparison = TBaseHelper.compareTo(this.row_cache_size, typedOther.row_cache_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPreload_row_cache()).compareTo(typedOther.isSetPreload_row_cache()); if (lastComparison != 0) { return lastComparison; } if (isSetPreload_row_cache()) { lastComparison = TBaseHelper.compareTo(this.preload_row_cache, typedOther.preload_row_cache); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetKey_cache_size()).compareTo(typedOther.isSetKey_cache_size()); if (lastComparison != 0) { return lastComparison; } if (isSetKey_cache_size()) { lastComparison = TBaseHelper.compareTo(this.key_cache_size, typedOther.key_cache_size); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRead_repair_chance()).compareTo(typedOther.isSetRead_repair_chance()); if (lastComparison != 0) { return lastComparison; } if (isSetRead_repair_chance()) { lastComparison = TBaseHelper.compareTo(this.read_repair_chance, typedOther.read_repair_chance); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetColumn_metadata()).compareTo(typedOther.isSetColumn_metadata()); if (lastComparison != 0) { return lastComparison; } if (isSetColumn_metadata()) { lastComparison = TBaseHelper.compareTo(this.column_metadata, typedOther.column_metadata); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetGc_grace_seconds()).compareTo(typedOther.isSetGc_grace_seconds()); if (lastComparison != 0) { return lastComparison; } if (isSetGc_grace_seconds()) { lastComparison = TBaseHelper.compareTo(this.gc_grace_seconds, typedOther.gc_grace_seconds); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDefault_validation_class()).compareTo(typedOther.isSetDefault_validation_class()); if (lastComparison != 0) { return lastComparison; } if (isSetDefault_validation_class()) { lastComparison = TBaseHelper.compareTo(this.default_validation_class, typedOther.default_validation_class); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = TBaseHelper.compareTo(this.id, typedOther.id); if (lastComparison != 0) { return lastComparison; } } return 0; } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // KEYSPACE if (field.type == TType.STRING) { this.keyspace = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // NAME if (field.type == TType.STRING) { this.name = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 3: // COLUMN_TYPE if (field.type == TType.STRING) { this.column_type = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 4: // CLOCK_TYPE if (field.type == TType.STRING) { this.clock_type = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 5: // COMPARATOR_TYPE if (field.type == TType.STRING) { this.comparator_type = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 6: // SUBCOMPARATOR_TYPE if (field.type == TType.STRING) { this.subcomparator_type = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 7: // RECONCILER if (field.type == TType.STRING) { this.reconciler = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 8: // COMMENT if (field.type == TType.STRING) { this.comment = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 9: // ROW_CACHE_SIZE if (field.type == TType.DOUBLE) { this.row_cache_size = iprot.readDouble(); setRow_cache_sizeIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 10: // PRELOAD_ROW_CACHE if (field.type == TType.BOOL) { this.preload_row_cache = iprot.readBool(); setPreload_row_cacheIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 11: // KEY_CACHE_SIZE if (field.type == TType.DOUBLE) { this.key_cache_size = iprot.readDouble(); setKey_cache_sizeIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 12: // READ_REPAIR_CHANCE if (field.type == TType.DOUBLE) { this.read_repair_chance = iprot.readDouble(); setRead_repair_chanceIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 13: // COLUMN_METADATA if (field.type == TType.LIST) { { TList _list25 = iprot.readListBegin(); this.column_metadata = new ArrayList<ColumnDef>(_list25.size); for (int _i26 = 0; _i26 < _list25.size; ++_i26) { ColumnDef _elem27; _elem27 = new ColumnDef(); _elem27.read(iprot); this.column_metadata.add(_elem27); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case 14: // GC_GRACE_SECONDS if (field.type == TType.I32) { this.gc_grace_seconds = iprot.readI32(); setGc_grace_secondsIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 15: // DEFAULT_VALIDATION_CLASS if (field.type == TType.STRING) { this.default_validation_class = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 16: // ID if (field.type == TType.I32) { this.id = iprot.readI32(); setIdIsSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.keyspace != null) { oprot.writeFieldBegin(KEYSPACE_FIELD_DESC); oprot.writeString(this.keyspace); oprot.writeFieldEnd(); } if (this.name != null) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(this.name); oprot.writeFieldEnd(); } if (this.column_type != null) { if (isSetColumn_type()) { oprot.writeFieldBegin(COLUMN_TYPE_FIELD_DESC); oprot.writeString(this.column_type); oprot.writeFieldEnd(); } } if (this.clock_type != null) { if (isSetClock_type()) { oprot.writeFieldBegin(CLOCK_TYPE_FIELD_DESC); oprot.writeString(this.clock_type); oprot.writeFieldEnd(); } } if (this.comparator_type != null) { if (isSetComparator_type()) { oprot.writeFieldBegin(COMPARATOR_TYPE_FIELD_DESC); oprot.writeString(this.comparator_type); oprot.writeFieldEnd(); } } if (this.subcomparator_type != null) { if (isSetSubcomparator_type()) { oprot.writeFieldBegin(SUBCOMPARATOR_TYPE_FIELD_DESC); oprot.writeString(this.subcomparator_type); oprot.writeFieldEnd(); } } if (this.reconciler != null) { if (isSetReconciler()) { oprot.writeFieldBegin(RECONCILER_FIELD_DESC); oprot.writeString(this.reconciler); oprot.writeFieldEnd(); } } if (this.comment != null) { if (isSetComment()) { oprot.writeFieldBegin(COMMENT_FIELD_DESC); oprot.writeString(this.comment); oprot.writeFieldEnd(); } } if (isSetRow_cache_size()) { oprot.writeFieldBegin(ROW_CACHE_SIZE_FIELD_DESC); oprot.writeDouble(this.row_cache_size); oprot.writeFieldEnd(); } if (isSetPreload_row_cache()) { oprot.writeFieldBegin(PRELOAD_ROW_CACHE_FIELD_DESC); oprot.writeBool(this.preload_row_cache); oprot.writeFieldEnd(); } if (isSetKey_cache_size()) { oprot.writeFieldBegin(KEY_CACHE_SIZE_FIELD_DESC); oprot.writeDouble(this.key_cache_size); oprot.writeFieldEnd(); } if (isSetRead_repair_chance()) { oprot.writeFieldBegin(READ_REPAIR_CHANCE_FIELD_DESC); oprot.writeDouble(this.read_repair_chance); oprot.writeFieldEnd(); } if (this.column_metadata != null) { if (isSetColumn_metadata()) { oprot.writeFieldBegin(COLUMN_METADATA_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.column_metadata.size())); for (ColumnDef _iter28 : this.column_metadata) { _iter28.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } } if (isSetGc_grace_seconds()) { oprot.writeFieldBegin(GC_GRACE_SECONDS_FIELD_DESC); oprot.writeI32(this.gc_grace_seconds); oprot.writeFieldEnd(); } if (this.default_validation_class != null) { if (isSetDefault_validation_class()) { oprot.writeFieldBegin(DEFAULT_VALIDATION_CLASS_FIELD_DESC); oprot.writeString(this.default_validation_class); oprot.writeFieldEnd(); } } if (isSetId()) { oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeI32(this.id); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("CfDef("); boolean first = true; sb.append("keyspace:"); if (this.keyspace == null) { sb.append("null"); } else { sb.append(this.keyspace); } first = false; if (!first) sb.append(", "); sb.append("name:"); if (this.name == null) { sb.append("null"); } else { sb.append(this.name); } first = false; if (isSetColumn_type()) { if (!first) sb.append(", "); sb.append("column_type:"); if (this.column_type == null) { sb.append("null"); } else { sb.append(this.column_type); } first = false; } if (isSetClock_type()) { if (!first) sb.append(", "); sb.append("clock_type:"); if (this.clock_type == null) { sb.append("null"); } else { sb.append(this.clock_type); } first = false; } if (isSetComparator_type()) { if (!first) sb.append(", "); sb.append("comparator_type:"); if (this.comparator_type == null) { sb.append("null"); } else { sb.append(this.comparator_type); } first = false; } if (isSetSubcomparator_type()) { if (!first) sb.append(", "); sb.append("subcomparator_type:"); if (this.subcomparator_type == null) { sb.append("null"); } else { sb.append(this.subcomparator_type); } first = false; } if (isSetReconciler()) { if (!first) sb.append(", "); sb.append("reconciler:"); if (this.reconciler == null) { sb.append("null"); } else { sb.append(this.reconciler); } first = false; } if (isSetComment()) { if (!first) sb.append(", "); sb.append("comment:"); if (this.comment == null) { sb.append("null"); } else { sb.append(this.comment); } first = false; } if (isSetRow_cache_size()) { if (!first) sb.append(", "); sb.append("row_cache_size:"); sb.append(this.row_cache_size); first = false; } if (isSetPreload_row_cache()) { if (!first) sb.append(", "); sb.append("preload_row_cache:"); sb.append(this.preload_row_cache); first = false; } if (isSetKey_cache_size()) { if (!first) sb.append(", "); sb.append("key_cache_size:"); sb.append(this.key_cache_size); first = false; } if (isSetRead_repair_chance()) { if (!first) sb.append(", "); sb.append("read_repair_chance:"); sb.append(this.read_repair_chance); first = false; } if (isSetColumn_metadata()) { if (!first) sb.append(", "); sb.append("column_metadata:"); if (this.column_metadata == null) { sb.append("null"); } else { sb.append(this.column_metadata); } first = false; } if (isSetGc_grace_seconds()) { if (!first) sb.append(", "); sb.append("gc_grace_seconds:"); sb.append(this.gc_grace_seconds); first = false; } if (isSetDefault_validation_class()) { if (!first) sb.append(", "); sb.append("default_validation_class:"); if (this.default_validation_class == null) { sb.append("null"); } else { sb.append(this.default_validation_class); } first = false; } if (isSetId()) { if (!first) sb.append(", "); sb.append("id:"); sb.append(this.id); first = false; } sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields if (keyspace == null) { throw new TProtocolException("Required field 'keyspace' was not present! Struct: " + toString()); } if (name == null) { throw new TProtocolException("Required field 'name' was not present! Struct: " + toString()); } } }