public boolean equals(TokenRange that) {
    if (that == null) return false;

    boolean this_present_start_token = true && this.isSetStart_token();
    boolean that_present_start_token = true && that.isSetStart_token();
    if (this_present_start_token || that_present_start_token) {
      if (!(this_present_start_token && that_present_start_token)) return false;
      if (!this.start_token.equals(that.start_token)) return false;
    }

    boolean this_present_end_token = true && this.isSetEnd_token();
    boolean that_present_end_token = true && that.isSetEnd_token();
    if (this_present_end_token || that_present_end_token) {
      if (!(this_present_end_token && that_present_end_token)) return false;
      if (!this.end_token.equals(that.end_token)) return false;
    }

    boolean this_present_endpoints = true && this.isSetEndpoints();
    boolean that_present_endpoints = true && that.isSetEndpoints();
    if (this_present_endpoints || that_present_endpoints) {
      if (!(this_present_endpoints && that_present_endpoints)) return false;
      if (!this.endpoints.equals(that.endpoints)) return false;
    }

    return true;
  }
 /** Performs a deep copy on <i>other</i>. */
 public TokenRange(TokenRange other) {
   if (other.isSetStart_token()) {
     this.start_token = other.start_token;
   }
   if (other.isSetEnd_token()) {
     this.end_token = other.end_token;
   }
   if (other.isSetEndpoints()) {
     List<String> __this__endpoints = new ArrayList<String>();
     for (String other_element : other.endpoints) {
       __this__endpoints.add(other_element);
     }
     this.endpoints = __this__endpoints;
   }
 }
  public int compareTo(TokenRange other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TokenRange typedOther = (TokenRange) other;

    lastComparison = Boolean.valueOf(isSetStart_token()).compareTo(typedOther.isSetStart_token());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStart_token()) {
      lastComparison = TBaseHelper.compareTo(this.start_token, typedOther.start_token);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEnd_token()).compareTo(typedOther.isSetEnd_token());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEnd_token()) {
      lastComparison = TBaseHelper.compareTo(this.end_token, typedOther.end_token);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetEndpoints()).compareTo(typedOther.isSetEndpoints());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEndpoints()) {
      lastComparison = TBaseHelper.compareTo(this.endpoints, typedOther.endpoints);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }