public MilliSeconds getMILLIS() { if (getSetField() == _Fields.MILLIS) { return (MilliSeconds)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'MILLIS' because union is currently set to " + getFieldDesc(getSetField()).name); } }
public boolean equals(Object other) { if (other instanceof TimeUnit) { return equals((TimeUnit)other); } else { return false; } }
public boolean equals(TimeUnit other) { return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TimeType struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.isAdjustedToUTC = iprot.readBool(); struct.setIsAdjustedToUTCIsSet(true); struct.unit = new TimeUnit(); struct.unit.read(iprot); struct.setUnitIsSet(true); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TimestampType struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBool(struct.isAdjustedToUTC); struct.unit.write(oprot); }
public TimeUnit deepCopy() { return new TimeUnit(this); }
private LogicalTypeAnnotation.TimeUnit convertTimeUnit(TimeUnit unit) { switch (unit.getSetField()) { case MICROS: return LogicalTypeAnnotation.TimeUnit.MICROS; case MILLIS: return LogicalTypeAnnotation.TimeUnit.MILLIS; case NANOS: return LogicalTypeAnnotation.TimeUnit.NANOS; default: throw new RuntimeException("Unknown time unit " + unit); } }
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); } }
public boolean equals(TimeUnit other) { return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TimeType struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.isAdjustedToUTC = iprot.readBool(); struct.setIsAdjustedToUTCIsSet(true); struct.unit = new TimeUnit(); struct.unit.read(iprot); struct.setUnitIsSet(true); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TimeType struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBool(struct.isAdjustedToUTC); struct.unit.write(oprot); }
public TimeUnit deepCopy() { return new TimeUnit(this); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.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); } }
public MicroSeconds getMICROS() { if (getSetField() == _Fields.MICROS) { return (MicroSeconds)getFieldValue(); } else { throw new RuntimeException("Cannot get field 'MICROS' because union is currently set to " + getFieldDesc(getSetField()).name); } }
@Override public int compareTo(TimeUnit other) { int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); if (lastComparison == 0) { return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); } return lastComparison; }