Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.hubspot.singularity;
 
 
  private final long timestamp;
  private final ExtendedTaskState taskState;
  private final Optional<StringstatusMessage;
  public static SingularityTaskHistoryUpdate fromBytes(byte[] bytesObjectMapper objectMapper) {
    try {
      return objectMapper.readValue(bytesSingularityTaskHistoryUpdate.class);
    } catch (IOException e) {
      throw new SingularityJsonException(e);
    }
  }
  public enum SimplifiedTaskState {
    UNKNOWN, WAITING, RUNNING, DONE
  }
  public static SingularityTaskHistoryUpdate getUpdate(final Iterable<SingularityTaskHistoryUpdateupdatesfinal ExtendedTaskState taskState) {
    return Iterables.find(updatesnew Predicate<SingularityTaskHistoryUpdate>() {
      @Override
      public boolean apply(SingularityTaskHistoryUpdate input) {
        return input.getTaskState() == taskState;
      }
    });
  }
    if (updates == null) {
      return state;
    }
    for (SingularityTaskHistoryUpdate update : updates) {
      if (update.getTaskState().isDone()) {
        return .;
      } else if (update.getTaskState() == .) {
        state = .;
      } else if (state == .) {
        state = .;
      }
    }
    return state;
  }
  public SingularityTaskHistoryUpdate(@JsonProperty("taskId"SingularityTaskId taskId, @JsonProperty("timestamp"long timestamp, @JsonProperty("taskState"ExtendedTaskState taskState, @JsonProperty("statusMessage"Optional<StringstatusMessage) {
    super(taskId);
    this. = timestamp;
    this. = taskState;
    this. = statusMessage;
  }
    return ComparisonChain.start()
        .compare(o.getTimestamp())
        .compare(o.getTaskId().getId(), getTaskId().getId())
        .result();
  }
  public long getTimestamp() {
    return ;
  }
    return ;
  }
    return ;
  }
  public String toString() {
    return "SingularityTaskHistoryUpdate [timestamp=" +  + ", taskState=" +  + ", statusMessage=" +  + "]";
  }
New to GrepCode? Check out our FAQ X