@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Timestamp) return this.equals((Timestamp)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case SECS_SINCE_EPOCH: return Long.valueOf(getSecsSinceEpoch()); case NANOS: return Integer.valueOf(getNanos()); } throw new IllegalStateException(); }
@Override public void clear() { setSecsSinceEpochIsSet(false); this.secsSinceEpoch = 0; setNanosIsSet(false); this.nanos = 0; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case SECS_SINCE_EPOCH: if (value == null) { unsetSecsSinceEpoch(); } else { setSecsSinceEpoch((Long)value); } break; case NANOS: if (value == null) { unsetNanos(); } else { setNanos((Integer)value); } break; } }
if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.secsSinceEpoch = iprot.readI64(); struct.setSecsSinceEpochIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.nanos = iprot.readI32(); struct.setNanosIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); if (!struct.isSetSecsSinceEpoch()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'secsSinceEpoch' was not found in serialized data! Struct: " + toString()); struct.validate();
/** 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 SECS_SINCE_EPOCH: return isSetSecsSinceEpoch(); case NANOS: return isSetNanos(); } throw new IllegalStateException(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, Timestamp struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(SECS_SINCE_EPOCH_FIELD_DESC); oprot.writeI64(struct.secsSinceEpoch); oprot.writeFieldEnd(); if (struct.isSetNanos()) { oprot.writeFieldBegin(NANOS_FIELD_DESC); oprot.writeI32(struct.nanos); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public boolean equals(Timestamp that) { if (that == null) return false; boolean this_present_secsSinceEpoch = true; boolean that_present_secsSinceEpoch = true; if (this_present_secsSinceEpoch || that_present_secsSinceEpoch) { if (!(this_present_secsSinceEpoch && that_present_secsSinceEpoch)) return false; if (this.secsSinceEpoch != that.secsSinceEpoch) return false; } boolean this_present_nanos = true && this.isSetNanos(); boolean that_present_nanos = true && that.isSetNanos(); if (this_present_nanos || that_present_nanos) { if (!(this_present_nanos && that_present_nanos)) return false; if (this.nanos != that.nanos) return false; } return true; }
public Timestamp deepCopy() { return new Timestamp(this); }
public Timestamp setNanos(int nanos) { this.nanos = nanos; setNanosIsSet(true); return this; }
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); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, Timestamp struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.secsSinceEpoch = iprot.readI64(); struct.setSecsSinceEpochIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.nanos = iprot.readI32(); struct.setNanosIsSet(true); } } }
@Override public int compareTo(Timestamp other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSecsSinceEpoch()).compareTo(other.isSetSecsSinceEpoch()); if (lastComparison != 0) { return lastComparison; } if (isSetSecsSinceEpoch()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secsSinceEpoch, other.secsSinceEpoch); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetNanos()).compareTo(other.isSetNanos()); if (lastComparison != 0) { return lastComparison; } if (isSetNanos()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nanos, other.nanos); if (lastComparison != 0) { return lastComparison; } } return 0; }
public static java.sql.Timestamp getTimestamp(Timestamp ts) { java.sql.Timestamp jts = new java.sql.Timestamp(ts.secsSinceEpoch); if (ts.isSetNanos()) { jts.setNanos(ts.nanos); } return jts; }
this.timestamp_val = new Timestamp(other.timestamp_val);