Skip to content

Instantly share code, notes, and snippets.

@ksiwonia
Created March 1, 2013 12:08
Show Gist options
  • Save ksiwonia/5064235 to your computer and use it in GitHub Desktop.
Save ksiwonia/5064235 to your computer and use it in GitHub Desktop.
public Date getDateField(final String fieldName) {
final Object fieldValue = getField(fieldName);
if (fieldValue == null) {
return null;
}
if (fieldValue instanceof Date) {
return (Date) fieldValue;
}
throw new IllegalArgumentException("Field " + fieldName + " in " + dataDefinition.getPluginIdentifier() + '.'
+ dataDefinition.getName() + " does not contain correct Date value");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment