{
JsonNode treeNode = jsonParser.readValueAsTree();
String periodType = treeNode.path("fieldType").path("name").asText();
String periodName = treeNode.path("periodType").path("name").asText();
// any "weird" numbers we should worry about?
int periodValue = treeNode.path(periodType).asInt();
if (periodName.equals( "Seconds" )) {
return Seconds.seconds( periodValue );
}
if (periodName.equals( "Minutes" )) {
return Minutes.minutes( periodValue );