Search in sources :

Example 1 with FormatMessage

use of com.google.api.services.clouddebugger.v2.model.FormatMessage in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudDebugProcessStateTest method createBreakpoint.

private static Breakpoint createBreakpoint(String id, Boolean isFinal, int finalTimeSeconds, String locationPath, Integer locationLine, Boolean isError, String statusMessage) {
    Breakpoint result = new Breakpoint();
    result.setId(id);
    result.setIsFinalState(isFinal);
    if (Boolean.TRUE.equals(isFinal)) {
        Calendar calendar = // gets a calendar using the default time zone and locale.
        Calendar.getInstance();
        calendar.add(Calendar.SECOND, finalTimeSeconds);
        DateTimeFormatter formatter = ISODateTimeFormat.dateTime();
        result.setFinalTime(formatter.print(calendar.getTimeInMillis()));
    }
    SourceLocation location = new SourceLocation();
    location.setPath(locationPath);
    location.setLine(locationLine);
    result.setLocation(location);
    StatusMessage status = new StatusMessage();
    status.setIsError(isError);
    FormatMessage message = new FormatMessage();
    message.setFormat(statusMessage);
    status.setDescription(message);
    result.setStatus(status);
    return result;
}
Also used : SourceLocation(com.google.api.services.clouddebugger.v2.model.SourceLocation) Breakpoint(com.google.api.services.clouddebugger.v2.model.Breakpoint) FormatMessage(com.google.api.services.clouddebugger.v2.model.FormatMessage) Calendar(java.util.Calendar) DateTimeFormatter(org.joda.time.format.DateTimeFormatter) StatusMessage(com.google.api.services.clouddebugger.v2.model.StatusMessage)

Aggregations

Breakpoint (com.google.api.services.clouddebugger.v2.model.Breakpoint)1 FormatMessage (com.google.api.services.clouddebugger.v2.model.FormatMessage)1 SourceLocation (com.google.api.services.clouddebugger.v2.model.SourceLocation)1 StatusMessage (com.google.api.services.clouddebugger.v2.model.StatusMessage)1 Calendar (java.util.Calendar)1 DateTimeFormatter (org.joda.time.format.DateTimeFormatter)1