package com.hubspot.singularity;

import java.util.Objects;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

public class SingularityUserSettings {
  private final Set<String> starredRequestIds;

  @JsonCreator
  public SingularityUserSettings(@JsonProperty("starredRequestIds") Set<String> starredRequestIds) {
    this.starredRequestIds = starredRequestIds;
  }

  public Set<String> getStarredRequestIds() {
    return starredRequestIds;
  }

  @Override
  public String toString() {
    return "SingularityUserSettings[" +
        "starredRequestIds=" + starredRequestIds +
        ']';
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SingularityUserSettings that = (SingularityUserSettings) o;
    return Objects.equals(starredRequestIds, that.starredRequestIds);
  }

  @Override
  public int hashCode() {
    return Objects.hash(starredRequestIds);
  }
}

@@ -44,22 +44,26 @@
 va.util.
-Object
+Collection
 s;%0Aimpor
@@ -186,16 +186,55 @@
 roperty;
+%0Aimport com.google.common.base.Objects;
 %0A%0Apublic
@@ -266,16 +266,47 @@
 tings %7B%0A
+  private final String userId;%0A
   privat
@@ -393,16 +393,68 @@
 ettings(
+%0A      @JsonProperty(%22userId%22) String userId,%0A      
 @JsonPro
@@ -526,125 +526,593 @@
 his.
-starredRequestIds = starredRequestIds;%0A  %7D%0A%0A  public Set%3CString%3E getStarredRequestIds() %7B%0A    return starredRequestId
+userId = userId;%0A    this.starredRequestIds = Objects.firstNonNull(starredRequestIds, Collections.%3CString%3EemptySet());%0A  %7D%0A%0A  public String getUserId() %7B%0A    return userId;%0A  %7D%0A%0A  public Set%3CString%3E getStarredRequestIds() %7B%0A    return starredRequestIds;%0A  %7D%0A%0A  public SingularityUserSettings addStarredRequestIds(Set%3CString%3E newStarredRequestIds) %7B%0A    starredRequestIds.addAll(newStarredRequestIds);%0A    return this;%0A  %7D%0A%0A  public SingularityUserSettings deleteStarredRequestIds(Set%3CString%3E oldStarredRequestIds) %7B%0A    starredRequestIds.removeAll(oldStarredRequestIds);%0A    return thi
 s;%0A 
@@ -1205,16 +1205,47 @@
        %22
+userId=%22 + userId +%0A        %22, 
 starredR
@@ -1463,24 +1463,25 @@
 alse;%0A    %7D%0A
+%0A
     Singular
@@ -1532,27 +1532,99 @@
 ngs) o;%0A
-    return 
+%0A    if (!Objects.equal(userId, that.userId)) %7B%0A      return false;%0A    %7D%0A    if (!
 Objects.
@@ -1628,17 +1628,16 @@
 ts.equal
-s
 (starred
@@ -1667,24 +1667,70 @@
 dRequestIds)
+) %7B%0A      return false;%0A    %7D%0A%0A    return true
 ;%0A  %7D%0A%0A  @Ov
@@ -1785,17 +1785,29 @@
 cts.hash
-(
+Code(userId, 
 starredR

Add add/delete starred requests methods to UserSettings, add userId, fix deps