public String getAsString(Map args, String key) { String result = null; Object value = args.get(key); if (value == null) { result = ""; } else if (value instanceof String) { result = (String) value; } else if (value instanceof String[]) { String[] array = (String[]) value; result = array[0]; } else { result = value.toString(); } return result; }
public boolean isFormType(Map args, String type) { Object value = args.get(type); return (value != null) && !value.equals(""); }
public void clearSavedArgs() { savedArgs.clear(); }
public void setSavedArg(String key, Object value) { savedArgs.put(key, value); }
public Object getSavedArg(String key) { return savedArgs.get(key); }
public void setPhotoCase(PhotoCase photoCase) { savedArgs.put(PHOTO_CASE, photoCase); }
public PhotoCase getPhotoCase() { return (PhotoCase) savedArgs.get(PHOTO_CASE); }
public void setHeading(String myHeading) { savedArgs.put(HEADING, myHeading); }
public Photo getPriorPhoto() { return (Photo) savedArgs.get(PRIOR_PHOTO); }
public void setPhoto(Photo newPhoto) { savedArgs.put(PHOTO, newPhoto); }
public Photo getPhoto() { return (Photo) savedArgs.get(PHOTO); }
public void setThreeLineMessage(String msg1, String msg2, String msg3) { savedArgs.put(MESSAGE, HtmlUtil.asPara(msg1) + HtmlUtil.asPara(msg2) + HtmlUtil.asPara(msg3)); }
public void setMessage(String myMessage) { savedArgs.put(MESSAGE, HtmlUtil.asPara(myMessage)); }
public String getMessage() { return (String) savedArgs.get(MESSAGE); }
public void setPriorPhoto(Photo oldPhoto) { savedArgs.put(PRIOR_PHOTO, oldPhoto); }
public String getAndSaveAsString(Map args, String key) { String result = getAsString(args, key); savedArgs.put(key, result); return result; }
public String getHeading() { return (String) savedArgs.get(HEADING); }