package com.hubspot.singularity;

import java.util.List;
import java.util.Objects;

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

public class SingularityRequestGroup {
    private final String id;
    private final List<String> requestIds;

    @JsonCreator
    public SingularityRequestGroup(@JsonProperty("id") String id, @JsonProperty("requestIds") List<String> requestIds) {
        this.id = id;
        this.requestIds = requestIds;
    }

    public String getId() {
        return id;
    }

    public List<String> getRequestIds() {
        return requestIds;
    }

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

    @Override
    public int hashCode() {
        return Objects.hash(id, requestIds);
    }

    @Override
    public String toString() {
        return "SingularityRequestGroup{" +
            "id='" + id + '\'' +
            ", requestIds=" + requestIds +
            '}';
    }
}

@@ -44,20 +44,72 @@
 va.util.
-List
+Collections;%0Aimport java.util.List;%0Aimport java.util.Map
 ;%0Aimport
@@ -347,16 +347,64 @@
 uestIds;
+%0A    private final Map%3CString, String%3E metadata;
 %0A%0A    @J
@@ -531,16 +531,72 @@
 questIds
+, @JsonProperty(%22metadata%22) Map%3CString, String%3E metadata
 ) %7B%0A    
@@ -643,32 +643,126 @@
 s = requestIds;%0A
+        this.metadata = metadata != null ? metadata : Collections.%3CString, String%3EemptyMap();%0A
     %7D%0A%0A    publi
@@ -874,32 +874,111 @@
 uestIds;%0A    %7D%0A%0A
+    public Map%3CString, String%3E getMetadata() %7B%0A        return metadata;%0A    %7D%0A%0A
     @Override%0A  
@@ -1325,32 +1325,87 @@
 that.requestIds)
+ &&%0A            Objects.equals(metadata, that.metadata)
 ;%0A    %7D%0A%0A    @Ov
@@ -1481,16 +1481,26 @@
 questIds
+, metadata
 );%0A    %7D
@@ -1666,16 +1666,55 @@
 stIds +%0A
+            %22, metadata=%22 + metadata +%0A
         

add metadata field to SingularityRequestGroup