com.rbkmoney.damsel.fraudbusters.P2PServiceSrv Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fraudbusters-proto Show documentation
Show all versions of fraudbusters-proto Show documentation
Generates jar artifact containing compiled thrift classes based on generated thrift IDL files
/**
* Autogenerated by Thrift Compiler (1.0.0-dev)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.rbkmoney.damsel.fraudbusters;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@Generated(value = "Autogenerated by Thrift Compiler (1.0.0-dev)", date = "2020-12-02")
public class P2PServiceSrv {
/**
* Интерфейс для управления FraudoP2P
*/
public interface Iface {
/**
* Проверяет компиляцию шаблонов на актуальной версии языка
*
*
* @param templates
*/
public ValidateTemplateResponse validateCompilationTemplate(List templates) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void validateCompilationTemplate(List templates, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public ValidateTemplateResponse validateCompilationTemplate(List templates) throws org.apache.thrift.TException
{
sendValidateCompilationTemplate(templates);
return recvValidateCompilationTemplate();
}
public void sendValidateCompilationTemplate(List templates) throws org.apache.thrift.TException
{
validateCompilationTemplate_args args = new validateCompilationTemplate_args();
args.setTemplates(templates);
sendBase("validateCompilationTemplate", args);
}
public ValidateTemplateResponse recvValidateCompilationTemplate() throws org.apache.thrift.TException
{
validateCompilationTemplate_result result = new validateCompilationTemplate_result();
receiveBase(result, "validateCompilationTemplate");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "validateCompilationTemplate failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void validateCompilationTemplate(List templates, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
validateCompilationTemplate_call method_call = new validateCompilationTemplate_call(templates, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class validateCompilationTemplate_call extends org.apache.thrift.async.TAsyncMethodCall {
private List templates;
public validateCompilationTemplate_call(List templates, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.templates = templates;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("validateCompilationTemplate", org.apache.thrift.protocol.TMessageType.CALL, 0));
validateCompilationTemplate_args args = new validateCompilationTemplate_args();
args.setTemplates(templates);
args.write(prot);
prot.writeMessageEnd();
}
public ValidateTemplateResponse getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recvValidateCompilationTemplate();
}
}
}
public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected Processor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> processMap) {
processMap.put("validateCompilationTemplate", new validateCompilationTemplate());
return processMap;
}
public static class validateCompilationTemplate extends org.apache.thrift.ProcessFunction {
public validateCompilationTemplate() {
super("validateCompilationTemplate");
}
public validateCompilationTemplate_args getEmptyArgsInstance() {
return new validateCompilationTemplate_args();
}
protected boolean isOneway() {
return false;
}
public validateCompilationTemplate_result getResult(I iface, validateCompilationTemplate_args args) throws org.apache.thrift.TException {
validateCompilationTemplate_result result = new validateCompilationTemplate_result();
result.success = iface.validateCompilationTemplate(args.templates);
return result;
}
}
}
public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected AsyncProcessor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> processMap) {
processMap.put("validateCompilationTemplate", new validateCompilationTemplate());
return processMap;
}
public static class validateCompilationTemplate extends org.apache.thrift.AsyncProcessFunction {
public validateCompilationTemplate() {
super("validateCompilationTemplate");
}
public validateCompilationTemplate_args getEmptyArgsInstance() {
return new validateCompilationTemplate_args();
}
public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback() {
public void onComplete(com.rbkmoney.damsel.fraudbusters.ValidateTemplateResponse o) {
validateCompilationTemplate_result result = new validateCompilationTemplate_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
validateCompilationTemplate_result result = new validateCompilationTemplate_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, validateCompilationTemplate_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
iface.validateCompilationTemplate(args.templates,resultHandler);
}
}
}
public static class validateCompilationTemplate_args 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("validateCompilationTemplate_args");
private static final org.apache.thrift.protocol.TField TEMPLATES_FIELD_DESC = new org.apache.thrift.protocol.TField("templates", org.apache.thrift.protocol.TType.LIST, (short)1);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new validateCompilationTemplate_argsStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new validateCompilationTemplate_argsTupleSchemeFactory();
public List templates; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TEMPLATES((short)1, "templates");
private static final Map byName = new HashMap();
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: // TEMPLATES
return TEMPLATES;
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
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TEMPLATES, new org.apache.thrift.meta_data.FieldMetaData("templates", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Template.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(validateCompilationTemplate_args.class, metaDataMap);
}
public validateCompilationTemplate_args() {
}
public validateCompilationTemplate_args(
List templates)
{
this();
this.templates = templates;
}
/**
* Performs a deep copy on other.
*/
public validateCompilationTemplate_args(validateCompilationTemplate_args other) {
if (other.isSetTemplates()) {
List __this__templates = new ArrayList(other.templates.size());
for (Template other_element : other.templates) {
__this__templates.add(new Template(other_element));
}
this.templates = __this__templates;
}
}
public validateCompilationTemplate_args deepCopy() {
return new validateCompilationTemplate_args(this);
}
@Override
public void clear() {
this.templates = null;
}
public int getTemplatesSize() {
return (this.templates == null) ? 0 : this.templates.size();
}
public java.util.Iterator getTemplatesIterator() {
return (this.templates == null) ? null : this.templates.iterator();
}
public void addToTemplates(Template elem) {
if (this.templates == null) {
this.templates = new ArrayList();
}
this.templates.add(elem);
}
public List getTemplates() {
return this.templates;
}
public validateCompilationTemplate_args setTemplates(List templates) {
this.templates = templates;
return this;
}
public void unsetTemplates() {
this.templates = null;
}
/** Returns true if field templates is set (has been assigned a value) and false otherwise */
public boolean isSetTemplates() {
return this.templates != null;
}
public void setTemplatesIsSet(boolean value) {
if (!value) {
this.templates = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TEMPLATES:
if (value == null) {
unsetTemplates();
} else {
setTemplates((List)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TEMPLATES:
return getTemplates();
}
throw new IllegalStateException();
}
/** 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 TEMPLATES:
return isSetTemplates();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof validateCompilationTemplate_args)
return this.equals((validateCompilationTemplate_args)that);
return false;
}
public boolean equals(validateCompilationTemplate_args that) {
if (that == null)
return false;
boolean this_present_templates = true && this.isSetTemplates();
boolean that_present_templates = true && that.isSetTemplates();
if (this_present_templates || that_present_templates) {
if (!(this_present_templates && that_present_templates))
return false;
if (!this.templates.equals(that.templates))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetTemplates()) ? 131071 : 524287);
if (isSetTemplates())
hashCode = hashCode * 8191 + templates.hashCode();
return hashCode;
}
@Override
public int compareTo(validateCompilationTemplate_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetTemplates()).compareTo(other.isSetTemplates());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTemplates()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.templates, other.templates);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public _Fields[] getFields() {
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("validateCompilationTemplate_args(");
boolean first = true;
sb.append("templates:");
if (this.templates == null) {
sb.append("null");
} else {
sb.append(this.templates);
}
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, 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 validateCompilationTemplate_argsStandardSchemeFactory implements SchemeFactory {
public validateCompilationTemplate_argsStandardScheme getScheme() {
return new validateCompilationTemplate_argsStandardScheme();
}
}
private static class validateCompilationTemplate_argsStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, validateCompilationTemplate_args 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: // TEMPLATES
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list64 = iprot.readListBegin();
struct.templates = new ArrayList(_list64.size);
Template _elem65;
for (int _i66 = 0; _i66 < _list64.size; ++_i66)
{
_elem65 = new Template();
_elem65.read(iprot);
struct.templates.add(_elem65);
}
iprot.readListEnd();
}
struct.setTemplatesIsSet(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();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, validateCompilationTemplate_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.templates != null) {
oprot.writeFieldBegin(TEMPLATES_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.templates.size()));
for (Template _iter67 : struct.templates)
{
_iter67.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class validateCompilationTemplate_argsTupleSchemeFactory implements SchemeFactory {
public validateCompilationTemplate_argsTupleScheme getScheme() {
return new validateCompilationTemplate_argsTupleScheme();
}
}
private static class validateCompilationTemplate_argsTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, validateCompilationTemplate_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetTemplates()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetTemplates()) {
{
oprot.writeI32(struct.templates.size());
for (Template _iter68 : struct.templates)
{
_iter68.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, validateCompilationTemplate_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.templates = new ArrayList(_list69.size);
Template _elem70;
for (int _i71 = 0; _i71 < _list69.size; ++_i71)
{
_elem70 = new Template();
_elem70.read(iprot);
struct.templates.add(_elem70);
}
}
struct.setTemplatesIsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class validateCompilationTemplate_result 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("validateCompilationTemplate_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final SchemeFactory STANDARD_SCHEME_FACTORY = new validateCompilationTemplate_resultStandardSchemeFactory();
private static final SchemeFactory TUPLE_SCHEME_FACTORY = new validateCompilationTemplate_resultTupleSchemeFactory();
public ValidateTemplateResponse success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map byName = new HashMap();
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 0: // SUCCESS
return SUCCESS;
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
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ValidateTemplateResponse.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(validateCompilationTemplate_result.class, metaDataMap);
}
public validateCompilationTemplate_result() {
}
public validateCompilationTemplate_result(
ValidateTemplateResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on other.
*/
public validateCompilationTemplate_result(validateCompilationTemplate_result other) {
if (other.isSetSuccess()) {
this.success = new ValidateTemplateResponse(other.success);
}
}
public validateCompilationTemplate_result deepCopy() {
return new validateCompilationTemplate_result(this);
}
@Override
public void clear() {
this.success = null;
}
public ValidateTemplateResponse getSuccess() {
return this.success;
}
public validateCompilationTemplate_result setSuccess(ValidateTemplateResponse success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((ValidateTemplateResponse)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
/** 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 SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof validateCompilationTemplate_result)
return this.equals((validateCompilationTemplate_result)that);
return false;
}
public boolean equals(validateCompilationTemplate_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.hashCode();
return hashCode;
}
@Override
public int compareTo(validateCompilationTemplate_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public _Fields[] getFields() {
return _Fields.values();
}
public Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> getFieldMetaData() {
return metaDataMap;
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("validateCompilationTemplate_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
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, 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 validateCompilationTemplate_resultStandardSchemeFactory implements SchemeFactory {
public validateCompilationTemplate_resultStandardScheme getScheme() {
return new validateCompilationTemplate_resultStandardScheme();
}
}
private static class validateCompilationTemplate_resultStandardScheme extends StandardScheme {
public void read(org.apache.thrift.protocol.TProtocol iprot, validateCompilationTemplate_result 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 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new ValidateTemplateResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(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();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, validateCompilationTemplate_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class validateCompilationTemplate_resultTupleSchemeFactory implements SchemeFactory {
public validateCompilationTemplate_resultTupleScheme getScheme() {
return new validateCompilationTemplate_resultTupleScheme();
}
}
private static class validateCompilationTemplate_resultTupleScheme extends TupleScheme {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, validateCompilationTemplate_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, validateCompilationTemplate_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new ValidateTemplateResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
private static S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
}