public EventClassFamilyVersion deepCopy() { return new EventClassFamilyVersion(this); }
public Object getFieldValue(_Fields field) { switch (field) { case ENDPOINT_CLASS_FAMILY_ID: return getEndpointClassFamilyId(); case ENDPOINT_CLASS_FAMILY_VERSION: return getEndpointClassFamilyVersion(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case ENDPOINT_CLASS_FAMILY_ID: if (value == null) { unsetEndpointClassFamilyId(); } else { setEndpointClassFamilyId((String)value); } break; case ENDPOINT_CLASS_FAMILY_VERSION: if (value == null) { unsetEndpointClassFamilyVersion(); } else { setEndpointClassFamilyVersion((Integer)value); } break; } }
/** 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 ENDPOINT_CLASS_FAMILY_ID: return isSetEndpointClassFamilyId(); case ENDPOINT_CLASS_FAMILY_VERSION: return isSetEndpointClassFamilyVersion(); } throw new IllegalStateException(); }
/** * Transform List(EventClassFamilyVersion) into Thrift * List(org.kaaproject.kaa.server.common.thrift.gen.operations.EventClassFamilyVersion). * * @param ecfVersions List(EventClassFamilyVersion) * @return thrift List(EventClassFamilyVersion) */ private static List<org.kaaproject.kaa.server.common.thrift.gen.operations.EventClassFamilyVersion> transformEcfv(List<EventClassFamilyVersion> ecfVersions) { List<org.kaaproject.kaa.server.common.thrift.gen.operations.EventClassFamilyVersion> ecfvThL = new ArrayList<>(); if (ecfVersions != null) { for (EventClassFamilyVersion ecfv : ecfVersions) { org.kaaproject.kaa.server.common.thrift.gen.operations.EventClassFamilyVersion ecfvTh = new org.kaaproject.kaa.server.common.thrift.gen.operations.EventClassFamilyVersion(); ecfvTh.setEndpointClassFamilyId(ecfv.getEcfId()); ecfvTh.setEndpointClassFamilyVersion(ecfv.getVersion()); ecfvThL.add(ecfvTh); } } return ecfvThL; }
for (int _i2 = 0; _i2 < _list0.size; ++_i2) _elem1 = new EventClassFamilyVersion(); _elem1.read(iprot); struct.eventClassFamilyVersion.add(_elem1);
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.endpointClassFamilyId = iprot.readString(); struct.setEndpointClassFamilyIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.endpointClassFamilyVersion = iprot.readI32(); struct.setEndpointClassFamilyVersionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, EventClassFamilyVersion struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.endpointClassFamilyId = iprot.readString(); struct.setEndpointClassFamilyIdIsSet(true); } if (incoming.get(1)) { struct.endpointClassFamilyVersion = iprot.readI32(); struct.setEndpointClassFamilyVersionIsSet(true); } } }
/** * Performs a deep copy on <i>other</i>. */ public EventClassFamilyVersion(EventClassFamilyVersion other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetEndpointClassFamilyId()) { this.endpointClassFamilyId = other.endpointClassFamilyId; } this.endpointClassFamilyVersion = other.endpointClassFamilyVersion; }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof EventClassFamilyVersion) return this.equals((EventClassFamilyVersion)that); return false; }
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); } }
for (int _i7 = 0; _i7 < _list5.size; ++_i7) _elem6 = new EventClassFamilyVersion(); _elem6.read(iprot); struct.eventClassFamilyVersion.add(_elem6);
@Override public int compareTo(EventClassFamilyVersion other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetEndpointClassFamilyId()).compareTo(other.isSetEndpointClassFamilyId()); if (lastComparison != 0) { return lastComparison; } if (isSetEndpointClassFamilyId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endpointClassFamilyId, other.endpointClassFamilyId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEndpointClassFamilyVersion()).compareTo(other.isSetEndpointClassFamilyVersion()); if (lastComparison != 0) { return lastComparison; } if (isSetEndpointClassFamilyVersion()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endpointClassFamilyVersion, other.endpointClassFamilyVersion); if (lastComparison != 0) { return lastComparison; } } return 0; }
public boolean equals(EventClassFamilyVersion that) { if (that == null) return false; boolean this_present_endpointClassFamilyId = true && this.isSetEndpointClassFamilyId(); boolean that_present_endpointClassFamilyId = true && that.isSetEndpointClassFamilyId(); if (this_present_endpointClassFamilyId || that_present_endpointClassFamilyId) { if (!(this_present_endpointClassFamilyId && that_present_endpointClassFamilyId)) return false; if (!this.endpointClassFamilyId.equals(that.endpointClassFamilyId)) return false; } boolean this_present_endpointClassFamilyVersion = true; boolean that_present_endpointClassFamilyVersion = true; if (this_present_endpointClassFamilyVersion || that_present_endpointClassFamilyVersion) { if (!(this_present_endpointClassFamilyVersion && that_present_endpointClassFamilyVersion)) return false; if (this.endpointClassFamilyVersion != that.endpointClassFamilyVersion) return false; } return true; }
/** * Transform EventRoute message from thrift service into RouteInfo and push * it to EventService listeners. * * @param route EventRoute */ private void onRouteUpdate(EventRoute route) { LOG.debug("onEventRouteUpdate .... {} routes updated in {} listeners", route.getRouteInfo().size(), listeners.size()); for (EventServiceListener listener : listeners) { for (org.kaaproject.kaa.server.common.thrift.gen.operations.RouteInfo routeInfo : route.getRouteInfo()) { String applicationToken = routeInfo.getApplicationToken(); EndpointObjectHash endpointKey = EndpointObjectHash.fromBytes(routeInfo.getEndpointId()); RouteTableAddress address = new RouteTableAddress( endpointKey, applicationToken, route.getOperationsServerId()); List<EventClassFamilyVersion> ecfVersions = new ArrayList<>(); for (org.kaaproject.kaa.server.common.thrift.gen.operations.EventClassFamilyVersion ecfv : routeInfo.getEventClassFamilyVersion()) { EventClassFamilyVersion ecf = new EventClassFamilyVersion( ecfv.getEndpointClassFamilyId(), ecfv.getEndpointClassFamilyVersion()); ecfVersions.add(ecf); } listener.onRouteInfo(new RouteInfo( route.getTenantId(), route.getUserId(), address, ecfVersions)); } } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, EventClassFamilyVersion struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetEndpointClassFamilyId()) { optionals.set(0); } if (struct.isSetEndpointClassFamilyVersion()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetEndpointClassFamilyId()) { oprot.writeString(struct.endpointClassFamilyId); } if (struct.isSetEndpointClassFamilyVersion()) { oprot.writeI32(struct.endpointClassFamilyVersion); } }
/** * Performs a deep copy on <i>other</i>. */ public RouteInfo(RouteInfo other) { if (other.isSetUpdateType()) { this.updateType = other.updateType; } if (other.isSetEventClassFamilyVersion()) { List<EventClassFamilyVersion> __this__eventClassFamilyVersion = new ArrayList<EventClassFamilyVersion>(other.eventClassFamilyVersion.size()); for (EventClassFamilyVersion other_element : other.eventClassFamilyVersion) { __this__eventClassFamilyVersion.add(new EventClassFamilyVersion(other_element)); } this.eventClassFamilyVersion = __this__eventClassFamilyVersion; } if (other.isSetApplicationToken()) { this.applicationToken = other.applicationToken; } if (other.isSetEndpointId()) { this.endpointId = other.endpointId; } }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_endpointClassFamilyId = true && (isSetEndpointClassFamilyId()); list.add(present_endpointClassFamilyId); if (present_endpointClassFamilyId) list.add(endpointClassFamilyId); boolean present_endpointClassFamilyVersion = true; list.add(present_endpointClassFamilyVersion); if (present_endpointClassFamilyVersion) list.add(endpointClassFamilyVersion); return list.hashCode(); }