/** * Performs a deep copy on <i>other</i>. */ public Token(Token other) { if (other.isSetValue()) { this.value = other.value; } }
public boolean equals(Token that) { if (that == null) return false; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); if (this_present_value || that_present_value) { if (!(this_present_value && that_present_value)) return false; if (!this.value.equals(that.value)) return false; } return true; }
/** 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 VALUE: return isSetValue(); } throw new IllegalStateException(); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_value = true && (isSetValue()); list.add(present_value); if (present_value) list.add(value); return list.hashCode(); }
@Override public int compareTo(Token other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } if (isSetValue()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); if (lastComparison != 0) { return lastComparison; } } return 0; }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetValue()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'value' is unset! Struct:" + toString()); } // check for sub-struct validity }