Created
November 19, 2018 21:52
-
-
Save pdtran3k6/d19e233cf876e8115a7a2db82c7ac32e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
public class JobMetadata { | |
private DateFormat simple = new SimpleDateFormat("dd MMM yyyy HH:mm:ss:SSS Z"); | |
private String id; | |
private String jobLink; | |
... | |
public JobMetadata(String id, String jobLink, String configLink, String started, String completed, String status, String user) { | |
this.id = id; | |
this.jobLink = jobLink; | |
this.configLink = configLink; | |
this.started = started; | |
this.completed = completed; | |
this.status = status; | |
this.user = user; | |
} | |
public static JobMetadata newInstance(String[] metadata) { | |
... | |
String started = metadata[1]; | |
String completed = metadata[2]; | |
... | |
return new JobMetadata(id, jobLink, configLink, started, completed, status, user); | |
} | |
... | |
public String getStarted() { | |
return simple.format(new Date(Long.parseLong(started))); | |
} | |
public String getCompleted() { | |
return simple.format(new Date(Long.parseLong(completed))); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment