mirror of https://github.com/apache/cassandra
354 lines
9.2 KiB
Java
354 lines
9.2 KiB
Java
/**
|
|
* Autogenerated by Thrift
|
|
*
|
|
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
|
*/
|
|
package org.apache.cassandra.service;
|
|
/*
|
|
*
|
|
* 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.Set;
|
|
import java.util.HashSet;
|
|
import java.util.Collections;
|
|
import org.apache.log4j.Logger;
|
|
|
|
import org.apache.thrift.*;
|
|
import org.apache.thrift.meta_data.*;
|
|
import org.apache.thrift.protocol.*;
|
|
|
|
public class BatchMutationSuper implements TBase, java.io.Serializable, Cloneable {
|
|
private static final TStruct STRUCT_DESC = new TStruct("BatchMutationSuper");
|
|
private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)1);
|
|
private static final TField CFMAP_FIELD_DESC = new TField("cfmap", TType.MAP, (short)2);
|
|
|
|
public String key;
|
|
public static final int KEY = 1;
|
|
public Map<String,List<SuperColumn>> cfmap;
|
|
public static final int CFMAP = 2;
|
|
|
|
private final Isset __isset = new Isset();
|
|
private static final class Isset implements java.io.Serializable {
|
|
}
|
|
|
|
public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
|
|
put(KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT,
|
|
new FieldValueMetaData(TType.STRING)));
|
|
put(CFMAP, new FieldMetaData("cfmap", TFieldRequirementType.DEFAULT,
|
|
new FieldValueMetaData(TType.MAP)));
|
|
}});
|
|
|
|
static {
|
|
FieldMetaData.addStructMetaDataMap(BatchMutationSuper.class, metaDataMap);
|
|
}
|
|
|
|
public BatchMutationSuper() {
|
|
}
|
|
|
|
public BatchMutationSuper(
|
|
String key,
|
|
Map<String,List<SuperColumn>> cfmap)
|
|
{
|
|
this();
|
|
this.key = key;
|
|
this.cfmap = cfmap;
|
|
}
|
|
|
|
/**
|
|
* Performs a deep copy on <i>other</i>.
|
|
*/
|
|
public BatchMutationSuper(BatchMutationSuper other) {
|
|
if (other.isSetKey()) {
|
|
this.key = other.key;
|
|
}
|
|
if (other.isSetCfmap()) {
|
|
this.cfmap = other.cfmap;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public BatchMutationSuper clone() {
|
|
return new BatchMutationSuper(this);
|
|
}
|
|
|
|
public String getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public BatchMutationSuper setKey(String key) {
|
|
this.key = key;
|
|
return this;
|
|
}
|
|
|
|
public void unsetKey() {
|
|
this.key = null;
|
|
}
|
|
|
|
// Returns true if field key is set (has been asigned a value) and false otherwise
|
|
public boolean isSetKey() {
|
|
return this.key != null;
|
|
}
|
|
|
|
public void setKeyIsSet(boolean value) {
|
|
if (!value) {
|
|
this.key = null;
|
|
}
|
|
}
|
|
|
|
public Map<String,List<SuperColumn>> getCfmap() {
|
|
return this.cfmap;
|
|
}
|
|
|
|
public BatchMutationSuper setCfmap(Map<String,List<SuperColumn>> cfmap) {
|
|
this.cfmap = cfmap;
|
|
return this;
|
|
}
|
|
|
|
public void unsetCfmap() {
|
|
this.cfmap = null;
|
|
}
|
|
|
|
// Returns true if field cfmap is set (has been asigned a value) and false otherwise
|
|
public boolean isSetCfmap() {
|
|
return this.cfmap != null;
|
|
}
|
|
|
|
public void setCfmapIsSet(boolean value) {
|
|
if (!value) {
|
|
this.cfmap = null;
|
|
}
|
|
}
|
|
|
|
public void setFieldValue(int fieldID, Object value) {
|
|
switch (fieldID) {
|
|
case KEY:
|
|
if (value == null) {
|
|
unsetKey();
|
|
} else {
|
|
setKey((String)value);
|
|
}
|
|
break;
|
|
|
|
case CFMAP:
|
|
if (value == null) {
|
|
unsetCfmap();
|
|
} else {
|
|
setCfmap((Map<String,List<SuperColumn>>)value);
|
|
}
|
|
break;
|
|
|
|
default:
|
|
throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
|
|
}
|
|
}
|
|
|
|
public Object getFieldValue(int fieldID) {
|
|
switch (fieldID) {
|
|
case KEY:
|
|
return getKey();
|
|
|
|
case CFMAP:
|
|
return getCfmap();
|
|
|
|
default:
|
|
throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
|
|
}
|
|
}
|
|
|
|
// Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
|
|
public boolean isSet(int fieldID) {
|
|
switch (fieldID) {
|
|
case KEY:
|
|
return isSetKey();
|
|
case CFMAP:
|
|
return isSetCfmap();
|
|
default:
|
|
throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object that) {
|
|
if (that == null)
|
|
return false;
|
|
if (that instanceof BatchMutationSuper)
|
|
return this.equals((BatchMutationSuper)that);
|
|
return false;
|
|
}
|
|
|
|
public boolean equals(BatchMutationSuper that) {
|
|
if (that == null)
|
|
return false;
|
|
|
|
boolean this_present_key = true && this.isSetKey();
|
|
boolean that_present_key = true && that.isSetKey();
|
|
if (this_present_key || that_present_key) {
|
|
if (!(this_present_key && that_present_key))
|
|
return false;
|
|
if (!this.key.equals(that.key))
|
|
return false;
|
|
}
|
|
|
|
boolean this_present_cfmap = true && this.isSetCfmap();
|
|
boolean that_present_cfmap = true && that.isSetCfmap();
|
|
if (this_present_cfmap || that_present_cfmap) {
|
|
if (!(this_present_cfmap && that_present_cfmap))
|
|
return false;
|
|
if (!this.cfmap.equals(that.cfmap))
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
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 KEY:
|
|
if (field.type == TType.STRING) {
|
|
this.key = iprot.readString();
|
|
} else {
|
|
TProtocolUtil.skip(iprot, field.type);
|
|
}
|
|
break;
|
|
case CFMAP:
|
|
if (field.type == TType.MAP) {
|
|
{
|
|
TMap _map13 = iprot.readMapBegin();
|
|
this.cfmap = new HashMap<String,List<SuperColumn>>(2*_map13.size);
|
|
for (int _i14 = 0; _i14 < _map13.size; ++_i14)
|
|
{
|
|
String _key15;
|
|
List<SuperColumn> _val16;
|
|
_key15 = iprot.readString();
|
|
{
|
|
TList _list17 = iprot.readListBegin();
|
|
_val16 = new ArrayList<SuperColumn>(_list17.size);
|
|
for (int _i18 = 0; _i18 < _list17.size; ++_i18)
|
|
{
|
|
SuperColumn _elem19;
|
|
_elem19 = new SuperColumn();
|
|
_elem19.read(iprot);
|
|
_val16.add(_elem19);
|
|
}
|
|
iprot.readListEnd();
|
|
}
|
|
this.cfmap.put(_key15, _val16);
|
|
}
|
|
iprot.readMapEnd();
|
|
}
|
|
} else {
|
|
TProtocolUtil.skip(iprot, field.type);
|
|
}
|
|
break;
|
|
default:
|
|
TProtocolUtil.skip(iprot, field.type);
|
|
break;
|
|
}
|
|
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.key != null) {
|
|
oprot.writeFieldBegin(KEY_FIELD_DESC);
|
|
oprot.writeString(this.key);
|
|
oprot.writeFieldEnd();
|
|
}
|
|
if (this.cfmap != null) {
|
|
oprot.writeFieldBegin(CFMAP_FIELD_DESC);
|
|
{
|
|
oprot.writeMapBegin(new TMap(TType.STRING, TType.LIST, this.cfmap.size()));
|
|
for (Map.Entry<String, List<SuperColumn>> _iter20 : this.cfmap.entrySet()) {
|
|
oprot.writeString(_iter20.getKey());
|
|
{
|
|
oprot.writeListBegin(new TList(TType.STRUCT, _iter20.getValue().size()));
|
|
for (SuperColumn _iter21 : _iter20.getValue()) {
|
|
_iter21.write(oprot);
|
|
}
|
|
oprot.writeListEnd();
|
|
}
|
|
}
|
|
oprot.writeMapEnd();
|
|
}
|
|
oprot.writeFieldEnd();
|
|
}
|
|
oprot.writeFieldStop();
|
|
oprot.writeStructEnd();
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder("BatchMutationSuper(");
|
|
boolean first = true;
|
|
|
|
sb.append("key:");
|
|
if (this.key == null) {
|
|
sb.append("null");
|
|
} else {
|
|
sb.append(this.key);
|
|
}
|
|
first = false;
|
|
if (!first) sb.append(", ");
|
|
sb.append("cfmap:");
|
|
if (this.cfmap == null) {
|
|
sb.append("null");
|
|
} else {
|
|
sb.append(this.cfmap);
|
|
}
|
|
first = false;
|
|
sb.append(")");
|
|
return sb.toString();
|
|
}
|
|
|
|
public void validate() throws TException {
|
|
// check for required fields
|
|
// check that fields of type enum have valid values
|
|
}
|
|
|
|
}
|
|
|