package com.hubspot.singularity;

import java.util.List;

public class SingularityScheduledTasksInfo {
  private final int numFutureTasks;
  private final long maxTaskLag;
  private final long timestamp;
  private final List<SingularityPendingTaskId> lateTasks;
  private final List<SingularityPendingTaskId> onDemandLateTasks;

  public SingularityScheduledTasksInfo(
    List<SingularityPendingTaskId> lateTasks,
    List<SingularityPendingTaskId> onDemandLateTasks,
    int numFutureTasks,
    long maxTaskLag,
    long timestamp
  ) {
    this.lateTasks = lateTasks;
    this.onDemandLateTasks = onDemandLateTasks;
    this.numFutureTasks = numFutureTasks;
    this.maxTaskLag = maxTaskLag;
    this.timestamp = timestamp;
  }

  public List<SingularityPendingTaskId> getLateTasks() {
    return lateTasks;
  }

  public List<SingularityPendingTaskId> getOnDemandLateTasks() {
    return onDemandLateTasks;
  }

  public int getNumFutureTasks() {
    return numFutureTasks;
  }

  public long getMaxTaskLag() {
    return maxTaskLag;
  }

  public long getTimestamp() {
    return timestamp;
  }
}

@@ -27,16 +27,123 @@
 arity;%0A%0A
+import com.fasterxml.jackson.annotation.JsonCreator;%0Aimport com.fasterxml.jackson.annotation.JsonProperty;%0A
 import j
@@ -157,16 +157,16 @@
 l.List;%0A
-
 %0Apublic 
@@ -429,16 +429,31 @@
 Tasks;%0A%0A
+  @JsonCreator%0A
   public
@@ -483,24 +483,51 @@
 sksInfo(%0A   
+ @JsonProperty(%22lateTasks%22)
  List%3CSingul
@@ -560,16 +560,51 @@
 sks,%0A   
+ @JsonProperty(%22onDemandLateTasks%22)
  List%3CSi
@@ -654,52 +654,139 @@
     
-int numFutureTasks,%0A    long maxTaskLag,%0A   
+@JsonProperty(%22numFutureTasks%22) int numFutureTasks,%0A    @JsonProperty(%22maxTaskLag%22) long maxTaskLag,%0A    @JsonProperty(%22timestamp%22)
  lon

add SingularityScheduledTasksInfo json serialization