public DateTime deepCopy() { return new DateTime(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof DateTime) return this.equals((DateTime)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case SECS_SINCE_EPOCH: return Long.valueOf(getSecsSinceEpoch()); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case SECS_SINCE_EPOCH: if (value == null) { unsetSecsSinceEpoch(); } else { setSecsSinceEpoch((Long)value); } break; } }
public void read(org.apache.thrift.protocol.TProtocol iprot, DateTime 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: // SECS_SINCE_EPOCH 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); } 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.isSetSecsSinceEpoch()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'secsSinceEpoch' was not found in serialized data! Struct: " + toString()); } struct.validate(); }
public DateTime( long secsSinceEpoch) { this(); this.secsSinceEpoch = secsSinceEpoch; setSecsSinceEpochIsSet(true); }
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); } }
/** 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(); } throw new IllegalStateException(); }
public void write(org.apache.thrift.protocol.TProtocol oprot, DateTime 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(); oprot.writeFieldStop(); oprot.writeStructEnd(); }
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); } }
case 10: // DATE_VAL if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.date_val = new DateTime(); struct.date_val.read(iprot); struct.setDate_valIsSet(true); } else { case 11: // TIME_VAL if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.time_val = new DateTime(); struct.time_val.read(iprot); struct.setTime_valIsSet(true); } else {
@Override public void clear() { setSecsSinceEpochIsSet(false); this.secsSinceEpoch = 0; }
@Override public int compareTo(DateTime 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; } } return 0; }
public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (decimal_val != null) { decimal_val.validate(); } if (date_val != null) { date_val.validate(); } if (time_val != null) { time_val.validate(); } if (timestamp_val != null) { timestamp_val.validate(); } if (blob_val != null) { blob_val.validate(); } if (clob_val != null) { clob_val.validate(); } if (pdx_val != null) { pdx_val.validate(); } if (json_val != null) { json_val.validate(); } }
public DateTime setSecsSinceEpoch(long secsSinceEpoch) { this.secsSinceEpoch = secsSinceEpoch; setSecsSinceEpochIsSet(true); return this; }