if (fieldValue.isTextual()) {
try {
// sometimes we erroneously get strings that would parse into valid numbers and maybe other edge
// cases (eg. when using system property overrides in typesafe-config). So we'll go ahead and guard
// with this regex to make sure we only get reasonable candidates.
Time time = prop.getAnnotation(Time.class);
if ((time != null) && NUMBER_UNIT.matcher(fieldValue.textValue()).matches()) {
Duration dropWizardDuration = Duration.parse(fieldValue.asText());
long asLong = time.value().convert(dropWizardDuration.getQuantity(), dropWizardDuration.getUnit());
fieldValues.put(propertyName, asLong);
} else if ((prop.getAnnotation(Bytes.class) != null) &&
NUMBER_UNIT.matcher(fieldValue.textValue()).matches()) {
Size dropWizardSize = Size.parse(fieldValue.asText());
long asLong = dropWizardSize.toBytes();