public static ExecutionChecker createFromJson(final HashMap<String, Object> jsonObj) throws Exception { if (!jsonObj.get("type").equals(type)) { throw new Exception("Cannot create checker of " + type + " from " + jsonObj.get("type")); } final int execId = Integer.valueOf((String) jsonObj.get("execId")); String jobName = null; if (jsonObj.containsKey("jobName")) { jobName = (String) jsonObj.get("jobName"); } final String checkerId = (String) jsonObj.get("checkerId"); final Status wantedStatus = Status.valueOf((String) jsonObj.get("wantedStatus")); return new ExecutionChecker(checkerId, execId, jobName, wantedStatus); }
public static ExecutionAttempt fromObject(final Object obj) { final Map<String, Object> map = (Map<String, Object>) obj; final TypedMapWrapper<String, Object> wrapper = new TypedMapWrapper<>(map); final int attempt = wrapper.getInt(ATTEMPT_PARAM); final long startTime = wrapper.getLong(STARTTIME_PARAM); final long endTime = wrapper.getLong(ENDTIME_PARAM); final Status status = Status.valueOf(wrapper.getString(STATUS_PARAM)); return new ExecutionAttempt(attempt, startTime, endTime, status); }
this.conditionOnJobStatus = ConditionOnJobStatus.fromString(wrappedMap.getString (CONDITION_ON_JOB_STATUS_PARAM)); this.status = Status.valueOf(wrappedMap.getString(STATUS_PARAM)); this.startTime = wrappedMap.getLong(STARTTIME_PARAM); this.endTime = wrappedMap.getLong(ENDTIME_PARAM);
public static ExecutionChecker createFromJson(HashMap<String, Object> jsonObj) throws Exception { if(!jsonObj.get("type").equals(type)) { throw new Exception("Cannot create checker of " + type + " from " + jsonObj.get("type")); } int execId = Integer.valueOf((String) jsonObj.get("execId")); String jobName = null; if(jsonObj.containsKey("jobName")) { jobName = (String) jsonObj.get("jobName"); } String checkerId = (String) jsonObj.get("checkerId"); Status wantedStatus = Status.valueOf((String)jsonObj.get("wantedStatus")); return new ExecutionChecker(checkerId, execId, jobName, wantedStatus); }
public static ExecutionChecker createFromJson(final HashMap<String, Object> jsonObj) throws Exception { if (!jsonObj.get("type").equals(type)) { throw new Exception("Cannot create checker of " + type + " from " + jsonObj.get("type")); } final int execId = Integer.valueOf((String) jsonObj.get("execId")); String jobName = null; if (jsonObj.containsKey("jobName")) { jobName = (String) jsonObj.get("jobName"); } final String checkerId = (String) jsonObj.get("checkerId"); final Status wantedStatus = Status.valueOf((String) jsonObj.get("wantedStatus")); return new ExecutionChecker(checkerId, execId, jobName, wantedStatus); }
this.id = wrappedMap.getString(ID_PARAM); this.type = wrappedMap.getString(TYPE_PARAM); this.status = Status.valueOf(wrappedMap.getString(STATUS_PARAM)); this.startTime = wrappedMap.getLong(STARTTIME_PARAM); this.endTime = wrappedMap.getLong(ENDTIME_PARAM);
public static ExecutionAttempt fromObject(final Object obj) { final Map<String, Object> map = (Map<String, Object>) obj; final TypedMapWrapper<String, Object> wrapper = new TypedMapWrapper<>(map); final int attempt = wrapper.getInt(ATTEMPT_PARAM); final long startTime = wrapper.getLong(STARTTIME_PARAM); final long endTime = wrapper.getLong(ENDTIME_PARAM); final Status status = Status.valueOf(wrapper.getString(STATUS_PARAM)); return new ExecutionAttempt(attempt, startTime, endTime, status); }
public static ExecutionAttempt fromObject(Object obj) { @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>)obj; TypedMapWrapper<String, Object> wrapper = new TypedMapWrapper<String, Object>(map); int attempt = wrapper.getInt(ATTEMPT_PARAM); long startTime = wrapper.getLong(STARTTIME_PARAM); long endTime = wrapper.getLong(ENDTIME_PARAM); Status status = Status.valueOf(wrapper.getString(STATUS_PARAM)); return new ExecutionAttempt(attempt, startTime, endTime, status); }
this.conditionOnJobStatus = ConditionOnJobStatus.fromString(wrappedMap.getString (CONDITION_ON_JOB_STATUS_PARAM)); this.status = Status.valueOf(wrappedMap.getString(STATUS_PARAM)); this.startTime = wrappedMap.getLong(STARTTIME_PARAM); this.endTime = wrappedMap.getLong(ENDTIME_PARAM);