Java tutorial
/* Copyright (C) 2013-2014 Computer Sciences Corporation * * Licensed 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. */ /** * Autogenerated by Thrift Compiler (0.9.1) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ezbake.services.provenance.thrift; import org.apache.commons.lang3.builder.HashCodeBuilder; 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.TException; import org.apache.thrift.async.AsyncMethodCallback; 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 org.slf4j.Logger; import org.slf4j.LoggerFactory; public class PurgeInfo implements org.apache.thrift.TBase<PurgeInfo, PurgeInfo._Fields>, java.io.Serializable, Cloneable, Comparable<PurgeInfo> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( "PurgeInfo"); private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField( "id", org.apache.thrift.protocol.TType.I64, (short) 1); private static final org.apache.thrift.protocol.TField TIME_STAMP_FIELD_DESC = new org.apache.thrift.protocol.TField( "timeStamp", org.apache.thrift.protocol.TType.STRUCT, (short) 2); private static final org.apache.thrift.protocol.TField DOCUMENT_URIS_FIELD_DESC = new org.apache.thrift.protocol.TField( "documentUris", org.apache.thrift.protocol.TType.LIST, (short) 3); private static final org.apache.thrift.protocol.TField DOCUMENT_URIS_NOT_FOUND_FIELD_DESC = new org.apache.thrift.protocol.TField( "documentUrisNotFound", org.apache.thrift.protocol.TType.LIST, (short) 4); private static final org.apache.thrift.protocol.TField PURGE_DOCUMENT_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField( "purgeDocumentIds", org.apache.thrift.protocol.TType.SET, (short) 5); private static final org.apache.thrift.protocol.TField COMPLETELY_PURGED_DOCUMENT_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField( "completelyPurgedDocumentIds", org.apache.thrift.protocol.TType.SET, (short) 6); private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField( "user", org.apache.thrift.protocol.TType.STRING, (short) 7); 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) 8); private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField( "description", org.apache.thrift.protocol.TType.STRING, (short) 9); private static final org.apache.thrift.protocol.TField RESOLVED_FIELD_DESC = new org.apache.thrift.protocol.TField( "resolved", org.apache.thrift.protocol.TType.BOOL, (short) 10); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new PurgeInfoStandardSchemeFactory()); schemes.put(TupleScheme.class, new PurgeInfoTupleSchemeFactory()); } public long id; // required public ezbake.base.thrift.DateTime timeStamp; // required public List<String> documentUris; // required public List<String> documentUrisNotFound; // required public Set<Long> purgeDocumentIds; // required public Set<Long> completelyPurgedDocumentIds; // required public String user; // required public String name; // optional public String description; // optional public boolean resolved; // 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 { ID((short) 1, "id"), TIME_STAMP((short) 2, "timeStamp"), DOCUMENT_URIS((short) 3, "documentUris"), DOCUMENT_URIS_NOT_FOUND((short) 4, "documentUrisNotFound"), PURGE_DOCUMENT_IDS( (short) 5, "purgeDocumentIds"), COMPLETELY_PURGED_DOCUMENT_IDS((short) 6, "completelyPurgedDocumentIds"), USER((short) 7, "user"), NAME((short) 8, "name"), DESCRIPTION((short) 9, "description"), RESOLVED((short) 10, "resolved"); 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: // ID return ID; case 2: // TIME_STAMP return TIME_STAMP; case 3: // DOCUMENT_URIS return DOCUMENT_URIS; case 4: // DOCUMENT_URIS_NOT_FOUND return DOCUMENT_URIS_NOT_FOUND; case 5: // PURGE_DOCUMENT_IDS return PURGE_DOCUMENT_IDS; case 6: // COMPLETELY_PURGED_DOCUMENT_IDS return COMPLETELY_PURGED_DOCUMENT_IDS; case 7: // USER return USER; case 8: // NAME return NAME; case 9: // DESCRIPTION return DESCRIPTION; case 10: // RESOLVED return RESOLVED; 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 __ID_ISSET_ID = 0; private static final int __RESOLVED_ISSET_ID = 1; private byte __isset_bitfield = 0; private _Fields optionals[] = { _Fields.NAME, _Fields.DESCRIPTION }; 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.TIME_STAMP, new org.apache.thrift.meta_data.FieldMetaData("timeStamp", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ezbake.base.thrift.DateTime.class))); tmpMap.put(_Fields.DOCUMENT_URIS, new org.apache.thrift.meta_data.FieldMetaData("documentUris", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData( org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.DOCUMENT_URIS_NOT_FOUND, new org.apache.thrift.meta_data.FieldMetaData("documentUrisNotFound", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData( org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.PURGE_DOCUMENT_IDS, new org.apache.thrift.meta_data.FieldMetaData("purgeDocumentIds", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); tmpMap.put(_Fields.COMPLETELY_PURGED_DOCUMENT_IDS, new org.apache.thrift.meta_data.FieldMetaData( "completelyPurgedDocumentIds", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); 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.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RESOLVED, new org.apache.thrift.meta_data.FieldMetaData("resolved", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(PurgeInfo.class, metaDataMap); } public PurgeInfo() { } public PurgeInfo(long id, ezbake.base.thrift.DateTime timeStamp, List<String> documentUris, List<String> documentUrisNotFound, Set<Long> purgeDocumentIds, Set<Long> completelyPurgedDocumentIds, String user, boolean resolved) { this(); this.id = id; setIdIsSet(true); this.timeStamp = timeStamp; this.documentUris = documentUris; this.documentUrisNotFound = documentUrisNotFound; this.purgeDocumentIds = purgeDocumentIds; this.completelyPurgedDocumentIds = completelyPurgedDocumentIds; this.user = user; this.resolved = resolved; setResolvedIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public PurgeInfo(PurgeInfo other) { __isset_bitfield = other.__isset_bitfield; this.id = other.id; if (other.isSetTimeStamp()) { this.timeStamp = new ezbake.base.thrift.DateTime(other.timeStamp); } if (other.isSetDocumentUris()) { List<String> __this__documentUris = new ArrayList<String>(other.documentUris); this.documentUris = __this__documentUris; } if (other.isSetDocumentUrisNotFound()) { List<String> __this__documentUrisNotFound = new ArrayList<String>(other.documentUrisNotFound); this.documentUrisNotFound = __this__documentUrisNotFound; } if (other.isSetPurgeDocumentIds()) { Set<Long> __this__purgeDocumentIds = new HashSet<Long>(other.purgeDocumentIds); this.purgeDocumentIds = __this__purgeDocumentIds; } if (other.isSetCompletelyPurgedDocumentIds()) { Set<Long> __this__completelyPurgedDocumentIds = new HashSet<Long>(other.completelyPurgedDocumentIds); this.completelyPurgedDocumentIds = __this__completelyPurgedDocumentIds; } if (other.isSetUser()) { this.user = other.user; } if (other.isSetName()) { this.name = other.name; } if (other.isSetDescription()) { this.description = other.description; } this.resolved = other.resolved; } public PurgeInfo deepCopy() { return new PurgeInfo(this); } @Override public void clear() { setIdIsSet(false); this.id = 0; this.timeStamp = null; this.documentUris = null; this.documentUrisNotFound = null; this.purgeDocumentIds = null; this.completelyPurgedDocumentIds = null; this.user = null; this.name = null; this.description = null; setResolvedIsSet(false); this.resolved = false; } public long getId() { return this.id; } public PurgeInfo setId(long id) { this.id = id; setIdIsSet(true); return this; } public void unsetId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public ezbake.base.thrift.DateTime getTimeStamp() { return this.timeStamp; } public PurgeInfo setTimeStamp(ezbake.base.thrift.DateTime timeStamp) { this.timeStamp = timeStamp; return this; } public void unsetTimeStamp() { this.timeStamp = null; } /** Returns true if field timeStamp is set (has been assigned a value) and false otherwise */ public boolean isSetTimeStamp() { return this.timeStamp != null; } public void setTimeStampIsSet(boolean value) { if (!value) { this.timeStamp = null; } } public int getDocumentUrisSize() { return (this.documentUris == null) ? 0 : this.documentUris.size(); } public java.util.Iterator<String> getDocumentUrisIterator() { return (this.documentUris == null) ? null : this.documentUris.iterator(); } public void addToDocumentUris(String elem) { if (this.documentUris == null) { this.documentUris = new ArrayList<String>(); } this.documentUris.add(elem); } public List<String> getDocumentUris() { return this.documentUris; } public PurgeInfo setDocumentUris(List<String> documentUris) { this.documentUris = documentUris; return this; } public void unsetDocumentUris() { this.documentUris = null; } /** Returns true if field documentUris is set (has been assigned a value) and false otherwise */ public boolean isSetDocumentUris() { return this.documentUris != null; } public void setDocumentUrisIsSet(boolean value) { if (!value) { this.documentUris = null; } } public int getDocumentUrisNotFoundSize() { return (this.documentUrisNotFound == null) ? 0 : this.documentUrisNotFound.size(); } public java.util.Iterator<String> getDocumentUrisNotFoundIterator() { return (this.documentUrisNotFound == null) ? null : this.documentUrisNotFound.iterator(); } public void addToDocumentUrisNotFound(String elem) { if (this.documentUrisNotFound == null) { this.documentUrisNotFound = new ArrayList<String>(); } this.documentUrisNotFound.add(elem); } public List<String> getDocumentUrisNotFound() { return this.documentUrisNotFound; } public PurgeInfo setDocumentUrisNotFound(List<String> documentUrisNotFound) { this.documentUrisNotFound = documentUrisNotFound; return this; } public void unsetDocumentUrisNotFound() { this.documentUrisNotFound = null; } /** Returns true if field documentUrisNotFound is set (has been assigned a value) and false otherwise */ public boolean isSetDocumentUrisNotFound() { return this.documentUrisNotFound != null; } public void setDocumentUrisNotFoundIsSet(boolean value) { if (!value) { this.documentUrisNotFound = null; } } public int getPurgeDocumentIdsSize() { return (this.purgeDocumentIds == null) ? 0 : this.purgeDocumentIds.size(); } public java.util.Iterator<Long> getPurgeDocumentIdsIterator() { return (this.purgeDocumentIds == null) ? null : this.purgeDocumentIds.iterator(); } public void addToPurgeDocumentIds(long elem) { if (this.purgeDocumentIds == null) { this.purgeDocumentIds = new HashSet<Long>(); } this.purgeDocumentIds.add(elem); } public Set<Long> getPurgeDocumentIds() { return this.purgeDocumentIds; } public PurgeInfo setPurgeDocumentIds(Set<Long> purgeDocumentIds) { this.purgeDocumentIds = purgeDocumentIds; return this; } public void unsetPurgeDocumentIds() { this.purgeDocumentIds = null; } /** Returns true if field purgeDocumentIds is set (has been assigned a value) and false otherwise */ public boolean isSetPurgeDocumentIds() { return this.purgeDocumentIds != null; } public void setPurgeDocumentIdsIsSet(boolean value) { if (!value) { this.purgeDocumentIds = null; } } public int getCompletelyPurgedDocumentIdsSize() { return (this.completelyPurgedDocumentIds == null) ? 0 : this.completelyPurgedDocumentIds.size(); } public java.util.Iterator<Long> getCompletelyPurgedDocumentIdsIterator() { return (this.completelyPurgedDocumentIds == null) ? null : this.completelyPurgedDocumentIds.iterator(); } public void addToCompletelyPurgedDocumentIds(long elem) { if (this.completelyPurgedDocumentIds == null) { this.completelyPurgedDocumentIds = new HashSet<Long>(); } this.completelyPurgedDocumentIds.add(elem); } public Set<Long> getCompletelyPurgedDocumentIds() { return this.completelyPurgedDocumentIds; } public PurgeInfo setCompletelyPurgedDocumentIds(Set<Long> completelyPurgedDocumentIds) { this.completelyPurgedDocumentIds = completelyPurgedDocumentIds; return this; } public void unsetCompletelyPurgedDocumentIds() { this.completelyPurgedDocumentIds = null; } /** Returns true if field completelyPurgedDocumentIds is set (has been assigned a value) and false otherwise */ public boolean isSetCompletelyPurgedDocumentIds() { return this.completelyPurgedDocumentIds != null; } public void setCompletelyPurgedDocumentIdsIsSet(boolean value) { if (!value) { this.completelyPurgedDocumentIds = null; } } public String getUser() { return this.user; } public PurgeInfo setUser(String user) { this.user = user; return this; } public void unsetUser() { this.user = null; } /** Returns true if field user is set (has been assigned a value) and false otherwise */ public boolean isSetUser() { return this.user != null; } public void setUserIsSet(boolean value) { if (!value) { this.user = null; } } public String getName() { return this.name; } public PurgeInfo setName(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; } } public String getDescription() { return this.description; } public PurgeInfo setDescription(String description) { this.description = description; return this; } public void unsetDescription() { this.description = null; } /** Returns true if field description is set (has been assigned a value) and false otherwise */ public boolean isSetDescription() { return this.description != null; } public void setDescriptionIsSet(boolean value) { if (!value) { this.description = null; } } public boolean isResolved() { return this.resolved; } public PurgeInfo setResolved(boolean resolved) { this.resolved = resolved; setResolvedIsSet(true); return this; } public void unsetResolved() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESOLVED_ISSET_ID); } /** Returns true if field resolved is set (has been assigned a value) and false otherwise */ public boolean isSetResolved() { return EncodingUtils.testBit(__isset_bitfield, __RESOLVED_ISSET_ID); } public void setResolvedIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESOLVED_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: if (value == null) { unsetId(); } else { setId((Long) value); } break; case TIME_STAMP: if (value == null) { unsetTimeStamp(); } else { setTimeStamp((ezbake.base.thrift.DateTime) value); } break; case DOCUMENT_URIS: if (value == null) { unsetDocumentUris(); } else { setDocumentUris((List<String>) value); } break; case DOCUMENT_URIS_NOT_FOUND: if (value == null) { unsetDocumentUrisNotFound(); } else { setDocumentUrisNotFound((List<String>) value); } break; case PURGE_DOCUMENT_IDS: if (value == null) { unsetPurgeDocumentIds(); } else { setPurgeDocumentIds((Set<Long>) value); } break; case COMPLETELY_PURGED_DOCUMENT_IDS: if (value == null) { unsetCompletelyPurgedDocumentIds(); } else { setCompletelyPurgedDocumentIds((Set<Long>) value); } break; case USER: if (value == null) { unsetUser(); } else { setUser((String) value); } break; case NAME: if (value == null) { unsetName(); } else { setName((String) value); } break; case DESCRIPTION: if (value == null) { unsetDescription(); } else { setDescription((String) value); } break; case RESOLVED: if (value == null) { unsetResolved(); } else { setResolved((Boolean) value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ID: return Long.valueOf(getId()); case TIME_STAMP: return getTimeStamp(); case DOCUMENT_URIS: return getDocumentUris(); case DOCUMENT_URIS_NOT_FOUND: return getDocumentUrisNotFound(); case PURGE_DOCUMENT_IDS: return getPurgeDocumentIds(); case COMPLETELY_PURGED_DOCUMENT_IDS: return getCompletelyPurgedDocumentIds(); case USER: return getUser(); case NAME: return getName(); case DESCRIPTION: return getDescription(); case RESOLVED: return Boolean.valueOf(isResolved()); } 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 ID: return isSetId(); case TIME_STAMP: return isSetTimeStamp(); case DOCUMENT_URIS: return isSetDocumentUris(); case DOCUMENT_URIS_NOT_FOUND: return isSetDocumentUrisNotFound(); case PURGE_DOCUMENT_IDS: return isSetPurgeDocumentIds(); case COMPLETELY_PURGED_DOCUMENT_IDS: return isSetCompletelyPurgedDocumentIds(); case USER: return isSetUser(); case NAME: return isSetName(); case DESCRIPTION: return isSetDescription(); case RESOLVED: return isSetResolved(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof PurgeInfo) return this.equals((PurgeInfo) that); return false; } public boolean equals(PurgeInfo that) { if (that == null) return false; boolean this_present_id = true; boolean that_present_id = true; if (this_present_id || that_present_id) { if (!(this_present_id && that_present_id)) return false; if (this.id != that.id) return false; } boolean this_present_timeStamp = true && this.isSetTimeStamp(); boolean that_present_timeStamp = true && that.isSetTimeStamp(); if (this_present_timeStamp || that_present_timeStamp) { if (!(this_present_timeStamp && that_present_timeStamp)) return false; if (!this.timeStamp.equals(that.timeStamp)) return false; } boolean this_present_documentUris = true && this.isSetDocumentUris(); boolean that_present_documentUris = true && that.isSetDocumentUris(); if (this_present_documentUris || that_present_documentUris) { if (!(this_present_documentUris && that_present_documentUris)) return false; if (!this.documentUris.equals(that.documentUris)) return false; } boolean this_present_documentUrisNotFound = true && this.isSetDocumentUrisNotFound(); boolean that_present_documentUrisNotFound = true && that.isSetDocumentUrisNotFound(); if (this_present_documentUrisNotFound || that_present_documentUrisNotFound) { if (!(this_present_documentUrisNotFound && that_present_documentUrisNotFound)) return false; if (!this.documentUrisNotFound.equals(that.documentUrisNotFound)) return false; } boolean this_present_purgeDocumentIds = true && this.isSetPurgeDocumentIds(); boolean that_present_purgeDocumentIds = true && that.isSetPurgeDocumentIds(); if (this_present_purgeDocumentIds || that_present_purgeDocumentIds) { if (!(this_present_purgeDocumentIds && that_present_purgeDocumentIds)) return false; if (!this.purgeDocumentIds.equals(that.purgeDocumentIds)) return false; } boolean this_present_completelyPurgedDocumentIds = true && this.isSetCompletelyPurgedDocumentIds(); boolean that_present_completelyPurgedDocumentIds = true && that.isSetCompletelyPurgedDocumentIds(); if (this_present_completelyPurgedDocumentIds || that_present_completelyPurgedDocumentIds) { if (!(this_present_completelyPurgedDocumentIds && that_present_completelyPurgedDocumentIds)) return false; if (!this.completelyPurgedDocumentIds.equals(that.completelyPurgedDocumentIds)) return false; } boolean this_present_user = true && this.isSetUser(); boolean that_present_user = true && that.isSetUser(); if (this_present_user || that_present_user) { if (!(this_present_user && that_present_user)) return false; if (!this.user.equals(that.user)) 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_description = true && this.isSetDescription(); boolean that_present_description = true && that.isSetDescription(); if (this_present_description || that_present_description) { if (!(this_present_description && that_present_description)) return false; if (!this.description.equals(that.description)) return false; } boolean this_present_resolved = true; boolean that_present_resolved = true; if (this_present_resolved || that_present_resolved) { if (!(this_present_resolved && that_present_resolved)) return false; if (this.resolved != that.resolved) return false; } return true; } @Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_id = true; builder.append(present_id); if (present_id) builder.append(id); boolean present_timeStamp = true && (isSetTimeStamp()); builder.append(present_timeStamp); if (present_timeStamp) builder.append(timeStamp); boolean present_documentUris = true && (isSetDocumentUris()); builder.append(present_documentUris); if (present_documentUris) builder.append(documentUris); boolean present_documentUrisNotFound = true && (isSetDocumentUrisNotFound()); builder.append(present_documentUrisNotFound); if (present_documentUrisNotFound) builder.append(documentUrisNotFound); boolean present_purgeDocumentIds = true && (isSetPurgeDocumentIds()); builder.append(present_purgeDocumentIds); if (present_purgeDocumentIds) builder.append(purgeDocumentIds); boolean present_completelyPurgedDocumentIds = true && (isSetCompletelyPurgedDocumentIds()); builder.append(present_completelyPurgedDocumentIds); if (present_completelyPurgedDocumentIds) builder.append(completelyPurgedDocumentIds); boolean present_user = true && (isSetUser()); builder.append(present_user); if (present_user) builder.append(user); boolean present_name = true && (isSetName()); builder.append(present_name); if (present_name) builder.append(name); boolean present_description = true && (isSetDescription()); builder.append(present_description); if (present_description) builder.append(description); boolean present_resolved = true; builder.append(present_resolved); if (present_resolved) builder.append(resolved); return builder.toHashCode(); } @Override public int compareTo(PurgeInfo other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); if (lastComparison != 0) { return lastComparison; } if (isSetId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTimeStamp()).compareTo(other.isSetTimeStamp()); if (lastComparison != 0) { return lastComparison; } if (isSetTimeStamp()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timeStamp, other.timeStamp); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDocumentUris()).compareTo(other.isSetDocumentUris()); if (lastComparison != 0) { return lastComparison; } if (isSetDocumentUris()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.documentUris, other.documentUris); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetDocumentUrisNotFound()).compareTo(other.isSetDocumentUrisNotFound()); if (lastComparison != 0) { return lastComparison; } if (isSetDocumentUrisNotFound()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.documentUrisNotFound, other.documentUrisNotFound); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPurgeDocumentIds()).compareTo(other.isSetPurgeDocumentIds()); if (lastComparison != 0) { return lastComparison; } if (isSetPurgeDocumentIds()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.purgeDocumentIds, other.purgeDocumentIds); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetCompletelyPurgedDocumentIds()) .compareTo(other.isSetCompletelyPurgedDocumentIds()); if (lastComparison != 0) { return lastComparison; } if (isSetCompletelyPurgedDocumentIds()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.completelyPurgedDocumentIds, other.completelyPurgedDocumentIds); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser()); if (lastComparison != 0) { return lastComparison; } if (isSetUser()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetName()).compareTo(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 = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription()); if (lastComparison != 0) { return lastComparison; } if (isSetDescription()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetResolved()).compareTo(other.isSetResolved()); if (lastComparison != 0) { return lastComparison; } if (isSetResolved()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resolved, other.resolved); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("PurgeInfo("); boolean first = true; sb.append("id:"); sb.append(this.id); first = false; if (!first) sb.append(", "); sb.append("timeStamp:"); if (this.timeStamp == null) { sb.append("null"); } else { sb.append(this.timeStamp); } first = false; if (!first) sb.append(", "); sb.append("documentUris:"); if (this.documentUris == null) { sb.append("null"); } else { sb.append(this.documentUris); } first = false; if (!first) sb.append(", "); sb.append("documentUrisNotFound:"); if (this.documentUrisNotFound == null) { sb.append("null"); } else { sb.append(this.documentUrisNotFound); } first = false; if (!first) sb.append(", "); sb.append("purgeDocumentIds:"); if (this.purgeDocumentIds == null) { sb.append("null"); } else { sb.append(this.purgeDocumentIds); } first = false; if (!first) sb.append(", "); sb.append("completelyPurgedDocumentIds:"); if (this.completelyPurgedDocumentIds == null) { sb.append("null"); } else { sb.append(this.completelyPurgedDocumentIds); } first = false; if (!first) sb.append(", "); sb.append("user:"); if (this.user == null) { sb.append("null"); } else { sb.append(this.user); } first = false; if (isSetName()) { if (!first) sb.append(", "); sb.append("name:"); if (this.name == null) { sb.append("null"); } else { sb.append(this.name); } first = false; } if (isSetDescription()) { if (!first) sb.append(", "); sb.append("description:"); if (this.description == null) { sb.append("null"); } else { sb.append(this.description); } first = false; } if (!first) sb.append(", "); sb.append("resolved:"); sb.append(this.resolved); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // alas, we cannot check 'id' because it's a primitive and you chose the non-beans generator. if (timeStamp == null) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'timeStamp' was not present! Struct: " + toString()); } if (documentUris == null) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'documentUris' was not present! Struct: " + toString()); } if (documentUrisNotFound == null) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'documentUrisNotFound' was not present! Struct: " + toString()); } if (purgeDocumentIds == null) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'purgeDocumentIds' was not present! Struct: " + toString()); } if (completelyPurgedDocumentIds == null) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'completelyPurgedDocumentIds' was not present! Struct: " + toString()); } if (user == null) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'user' was not present! Struct: " + toString()); } // alas, we cannot check 'resolved' because it's a primitive and you chose the non-beans generator. // check for sub-struct validity if (timeStamp != null) { timeStamp.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 { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; 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 PurgeInfoStandardSchemeFactory implements SchemeFactory { public PurgeInfoStandardScheme getScheme() { return new PurgeInfoStandardScheme(); } } private static class PurgeInfoStandardScheme extends StandardScheme<PurgeInfo> { public void read(org.apache.thrift.protocol.TProtocol iprot, PurgeInfo 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: // ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.id = iprot.readI64(); struct.setIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TIME_STAMP if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.timeStamp = new ezbake.base.thrift.DateTime(); struct.timeStamp.read(iprot); struct.setTimeStampIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // DOCUMENT_URIS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list124 = iprot.readListBegin(); struct.documentUris = new ArrayList<String>(_list124.size); for (int _i125 = 0; _i125 < _list124.size; ++_i125) { String _elem126; _elem126 = iprot.readString(); struct.documentUris.add(_elem126); } iprot.readListEnd(); } struct.setDocumentUrisIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // DOCUMENT_URIS_NOT_FOUND if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list127 = iprot.readListBegin(); struct.documentUrisNotFound = new ArrayList<String>(_list127.size); for (int _i128 = 0; _i128 < _list127.size; ++_i128) { String _elem129; _elem129 = iprot.readString(); struct.documentUrisNotFound.add(_elem129); } iprot.readListEnd(); } struct.setDocumentUrisNotFoundIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 5: // PURGE_DOCUMENT_IDS if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set130 = iprot.readSetBegin(); struct.purgeDocumentIds = new HashSet<Long>(2 * _set130.size); for (int _i131 = 0; _i131 < _set130.size; ++_i131) { long _elem132; _elem132 = iprot.readI64(); struct.purgeDocumentIds.add(_elem132); } iprot.readSetEnd(); } struct.setPurgeDocumentIdsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 6: // COMPLETELY_PURGED_DOCUMENT_IDS if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { org.apache.thrift.protocol.TSet _set133 = iprot.readSetBegin(); struct.completelyPurgedDocumentIds = new HashSet<Long>(2 * _set133.size); for (int _i134 = 0; _i134 < _set133.size; ++_i134) { long _elem135; _elem135 = iprot.readI64(); struct.completelyPurgedDocumentIds.add(_elem135); } iprot.readSetEnd(); } struct.setCompletelyPurgedDocumentIdsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 7: // USER if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.user = iprot.readString(); struct.setUserIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 8: // 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 9: // DESCRIPTION if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.description = iprot.readString(); struct.setDescriptionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 10: // RESOLVED if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.resolved = iprot.readBool(); struct.setResolvedIsSet(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 if (!struct.isSetId()) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'id' was not found in serialized data! Struct: " + toString()); } if (!struct.isSetResolved()) { throw new org.apache.thrift.protocol.TProtocolException( "Required field 'resolved' was not found in serialized data! Struct: " + toString()); } struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, PurgeInfo struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeI64(struct.id); oprot.writeFieldEnd(); if (struct.timeStamp != null) { oprot.writeFieldBegin(TIME_STAMP_FIELD_DESC); struct.timeStamp.write(oprot); oprot.writeFieldEnd(); } if (struct.documentUris != null) { oprot.writeFieldBegin(DOCUMENT_URIS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRING, struct.documentUris.size())); for (String _iter136 : struct.documentUris) { oprot.writeString(_iter136); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.documentUrisNotFound != null) { oprot.writeFieldBegin(DOCUMENT_URIS_NOT_FOUND_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRING, struct.documentUrisNotFound.size())); for (String _iter137 : struct.documentUrisNotFound) { oprot.writeString(_iter137); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.purgeDocumentIds != null) { oprot.writeFieldBegin(PURGE_DOCUMENT_IDS_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, struct.purgeDocumentIds.size())); for (long _iter138 : struct.purgeDocumentIds) { oprot.writeI64(_iter138); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } if (struct.completelyPurgedDocumentIds != null) { oprot.writeFieldBegin(COMPLETELY_PURGED_DOCUMENT_IDS_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I64, struct.completelyPurgedDocumentIds.size())); for (long _iter139 : struct.completelyPurgedDocumentIds) { oprot.writeI64(_iter139); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } if (struct.user != null) { oprot.writeFieldBegin(USER_FIELD_DESC); oprot.writeString(struct.user); oprot.writeFieldEnd(); } if (struct.name != null) { if (struct.isSetName()) { oprot.writeFieldBegin(NAME_FIELD_DESC); oprot.writeString(struct.name); oprot.writeFieldEnd(); } } if (struct.description != null) { if (struct.isSetDescription()) { oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC); oprot.writeString(struct.description); oprot.writeFieldEnd(); } } oprot.writeFieldBegin(RESOLVED_FIELD_DESC); oprot.writeBool(struct.resolved); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class PurgeInfoTupleSchemeFactory implements SchemeFactory { public PurgeInfoTupleScheme getScheme() { return new PurgeInfoTupleScheme(); } } private static class PurgeInfoTupleScheme extends TupleScheme<PurgeInfo> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, PurgeInfo struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI64(struct.id); struct.timeStamp.write(oprot); { oprot.writeI32(struct.documentUris.size()); for (String _iter140 : struct.documentUris) { oprot.writeString(_iter140); } } { oprot.writeI32(struct.documentUrisNotFound.size()); for (String _iter141 : struct.documentUrisNotFound) { oprot.writeString(_iter141); } } { oprot.writeI32(struct.purgeDocumentIds.size()); for (long _iter142 : struct.purgeDocumentIds) { oprot.writeI64(_iter142); } } { oprot.writeI32(struct.completelyPurgedDocumentIds.size()); for (long _iter143 : struct.completelyPurgedDocumentIds) { oprot.writeI64(_iter143); } } oprot.writeString(struct.user); oprot.writeBool(struct.resolved); BitSet optionals = new BitSet(); if (struct.isSetName()) { optionals.set(0); } if (struct.isSetDescription()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetName()) { oprot.writeString(struct.name); } if (struct.isSetDescription()) { oprot.writeString(struct.description); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, PurgeInfo struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.id = iprot.readI64(); struct.setIdIsSet(true); struct.timeStamp = new ezbake.base.thrift.DateTime(); struct.timeStamp.read(iprot); struct.setTimeStampIsSet(true); { org.apache.thrift.protocol.TList _list144 = new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.documentUris = new ArrayList<String>(_list144.size); for (int _i145 = 0; _i145 < _list144.size; ++_i145) { String _elem146; _elem146 = iprot.readString(); struct.documentUris.add(_elem146); } } struct.setDocumentUrisIsSet(true); { org.apache.thrift.protocol.TList _list147 = new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.documentUrisNotFound = new ArrayList<String>(_list147.size); for (int _i148 = 0; _i148 < _list147.size; ++_i148) { String _elem149; _elem149 = iprot.readString(); struct.documentUrisNotFound.add(_elem149); } } struct.setDocumentUrisNotFoundIsSet(true); { org.apache.thrift.protocol.TSet _set150 = new org.apache.thrift.protocol.TSet( org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.purgeDocumentIds = new HashSet<Long>(2 * _set150.size); for (int _i151 = 0; _i151 < _set150.size; ++_i151) { long _elem152; _elem152 = iprot.readI64(); struct.purgeDocumentIds.add(_elem152); } } struct.setPurgeDocumentIdsIsSet(true); { org.apache.thrift.protocol.TSet _set153 = new org.apache.thrift.protocol.TSet( org.apache.thrift.protocol.TType.I64, iprot.readI32()); struct.completelyPurgedDocumentIds = new HashSet<Long>(2 * _set153.size); for (int _i154 = 0; _i154 < _set153.size; ++_i154) { long _elem155; _elem155 = iprot.readI64(); struct.completelyPurgedDocumentIds.add(_elem155); } } struct.setCompletelyPurgedDocumentIdsIsSet(true); struct.user = iprot.readString(); struct.setUserIsSet(true); struct.resolved = iprot.readBool(); struct.setResolvedIsSet(true); BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); } if (incoming.get(1)) { struct.description = iprot.readString(); struct.setDescriptionIsSet(true); } } } }