private ThriftEntityClusterAddress toEntityClusterAddress(EntityClusterAddress source) { ThriftEntityClusterAddress address = new ThriftEntityClusterAddress(); address.setNodeId(source.getNodeId()); address.setAddress(toEntityAddress(source)); return address; }
public Object getFieldValue(_Fields field) { switch (field) { case NODE_ID: return getNodeId(); case ADDRESS: return getAddress(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof ThriftEntityClusterAddress) return this.equals((ThriftEntityClusterAddress)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case NODE_ID: if (value == null) { unsetNodeId(); } else { setNodeId((String)value); } break; case ADDRESS: if (value == null) { unsetAddress(); } else { setAddress((ThriftEntityAddress)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 NODE_ID: return isSetNodeId(); case ADDRESS: return isSetAddress(); } throw new IllegalStateException(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftEntityRouteMessage struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.address = new ThriftEntityClusterAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } if (incoming.get(1)) { struct.operation = org.kaaproject.kaa.server.common.thrift.gen.operations.ThriftRouteOperation.findByValue(iprot.readI32()); struct.setOperationIsSet(true); } } }
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.nodeId = iprot.readString(); struct.setNodeIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.address = new ThriftEntityAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
private ThriftEntityClusterAddress toAddress(EndpointClusterAddress source) { ThriftEntityClusterAddress address = toEntityClusterAddress(source); address.getAddress().setEntityType(ThriftClusterEntityType.ENDPOINT); return address; }
public ThriftEntityClusterAddress deepCopy() { return new ThriftEntityClusterAddress(this); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftEntityClusterAddress struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.nodeId = iprot.readString(); struct.setNodeIdIsSet(true); } if (incoming.get(1)) { struct.address = new ThriftEntityAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } } }
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); } }
/** * Performs a deep copy on <i>other</i>. */ public ThriftEntityClusterAddress(ThriftEntityClusterAddress other) { if (other.isSetNodeId()) { this.nodeId = other.nodeId; } if (other.isSetAddress()) { this.address = new ThriftEntityAddress(other.address); } }
case 1: // ADDRESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.address = new ThriftEntityClusterAddress(); struct.address.read(iprot); struct.setAddressIsSet(true); } else {
@Override public void onEntityRouteMessages(List<ThriftEntityRouteMessage> msgs) { for (ThriftEntityRouteMessage msg : msgs) { switch (msg.getAddress().getAddress().getEntityType()) { case ENDPOINT: listener.onRouteMsg(fromThriftMsg(msg)); break; default: LOG.error("Unknown entity type: {}", msg.getAddress().getAddress().getEntityType()); } } }
/** * Performs a deep copy on <i>other</i>. */ public ThriftEntityRouteMessage(ThriftEntityRouteMessage other) { if (other.isSetAddress()) { this.address = new ThriftEntityClusterAddress(other.address); } if (other.isSetOperation()) { this.operation = other.operation; } }
private EndpointClusterAddress fromThriftAddress(ThriftEntityClusterAddress source) { ThriftEntityAddress address = source.getAddress(); EndpointObjectHash endpointKey = EndpointObjectHash.fromBytes(address.getEntityId()); return new EndpointClusterAddress( source.getNodeId(), address.getTenantId(), address.getApplicationToken(), endpointKey); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_nodeId = true && (isSetNodeId()); list.add(present_nodeId); if (present_nodeId) list.add(nodeId); boolean present_address = true && (isSetAddress()); list.add(present_address); if (present_address) list.add(address); return list.hashCode(); }
public boolean equals(ThriftEntityRouteMessage that) { if (that == null) return false; boolean this_present_address = true && this.isSetAddress(); boolean that_present_address = true && that.isSetAddress(); if (this_present_address || that_present_address) { if (!(this_present_address && that_present_address)) return false; if (!this.address.equals(that.address)) return false; } boolean this_present_operation = true && this.isSetOperation(); boolean that_present_operation = true && that.isSetOperation(); if (this_present_operation || that_present_operation) { if (!(this_present_operation && that_present_operation)) return false; if (!this.operation.equals(that.operation)) return false; } return true; }
public boolean equals(ThriftEntityClusterAddress that) { if (that == null) return false; boolean this_present_nodeId = true && this.isSetNodeId(); boolean that_present_nodeId = true && that.isSetNodeId(); if (this_present_nodeId || that_present_nodeId) { if (!(this_present_nodeId && that_present_nodeId)) return false; if (!this.nodeId.equals(that.nodeId)) return false; } boolean this_present_address = true && this.isSetAddress(); boolean that_present_address = true && that.isSetAddress(); if (this_present_address || that_present_address) { if (!(this_present_address && that_present_address)) return false; if (!this.address.equals(that.address)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftEntityClusterAddress struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetNodeId()) { optionals.set(0); } if (struct.isSetAddress()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetNodeId()) { oprot.writeString(struct.nodeId); } if (struct.isSetAddress()) { struct.address.write(oprot); } }