// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;
import com.google.auto.value.AutoValue;
/**
 * Class representing user data specific to a competition
 */
@AutoValue
public abstract class CompetitorInfo {
  public static CompetitorInfo create(
      int rank, Integer rankYesterday, String name, String email, long netWorth, long amountAvailable) {
    return new AutoValue_CompetitorInfo(rank, rankYesterday, name, email, netWorth, amountAvailable);
  }

  /** The current ranking of the user in this competition based on networth */
  public abstract int rank();
  /** The rank of the user yesterday for purposes of displaying rises/falls in leaderboard */
  public abstract Integer rankYesterday();
  /** The competitor's name */
  public abstract String name();
  /** The competitor's Google email */
  public abstract String email();
  /** The networth of the competitor */
  public abstract long netWorth();
  /** The amount the user has available for additional investments */
  public abstract long amountAvailable();
}

@@ -615,47 +615,8 @@
 ta;%0A
-import com.google.auto.value.AutoValue;
 %0A/**
@@ -682,877 +682,863 @@
  */%0A
-@AutoValue%0Apublic abstract class CompetitorInfo %7B%0A  public static CompetitorInfo create(%0A      int rank, Integer rankYesterday, String name, String email, long netWorth, long amountAvailable) %7B%0A    return new AutoValue_CompetitorInfo(rank, rankYesterday, name, email, netWorth, amountAvailable);%0A  %7D%0A%0A  /** The current ranking of the user in this competition based on networth */%0A  public abstract int rank();%0A  /** The rank of the user yesterday for purposes of displaying rises/falls in leaderboard */%0A  public abstract Integer rankYesterday();%0A  /** The competitor's name */%0A  public abstract String
+public class CompetitorInfo implements Comparable%3CCompetitorInfo%3E %7B%0A  /** The id of the competitor */%0A  private long id;%0A%0A  /** The name of the competitor */%0A  private String name;%0A%0A  /** The email of the competitor */%0A  private String email;%0A%0A  /** The networth of the competitor */%0A  private int netWorth;%0A%0A  /** The amount the competitor has available to spend */%0A  private int amountAvailable;%0A%0A  public CompetitorInfo(long id, String name, String email, int netWorth, int amountAvailable) %7B%0A    this.id = id;%0A    this.name =
  name
-()
 ;%0A  
-/** The competitor's Google email */%0A  public abstract String email();%0A  /** The networth of the competitor */%0A  public abstract long netWorth();%0A  /** The amount the user has available for additional investments */%0A  public abstract long amountAvailable();%0A
+  this.email = email;%0A    this.netWorth = netWorth;%0A    this.amountAvailable = amountAvailable;%0A  %7D%0A%0A  @Override%0A  public int compareTo(CompetitorInfo c2) %7B%0A    return this.getNetWorth() - c2.getNetWorth();%0A  %7D%0A%0A  public long getId() %7B%0A    return this.id;%0A  %7D%0A%0A  public int getNetWorth() %7B%0A    return this.netWorth;%0A  
 %7D%0A
+%7D

Remove autovalue in order to add custom comparator