protected Granularity generateGranularity(String granularity,GranularityParser granularityParser) throws BadApiRequestException {
  try {
    return granularityParser.parseGranularity(granularity);
  }
 catch (  GranularityParseException e) {
    LOG.error(UNKNOWN_GRANULARITY.logFormat(granularity),granularity);
    throw new BadApiRequestException(e.getMessage());
  }
}

protected Granularity generateGranularity ( String granularity , GranularityParser granularityParser ) throws BadApiRequestException { try { return granularityParser . parseGranularity ( granularity ) ; } catch ( GranularityParseException e ) { LOG . error ( UNKNOWN_GRANULARITY . logFormat ( granularity ) , granularity ) ; throw new BadApiRequestException ( e . getMessage ( ) ) ; } }
generate a granularity instance based on a path element .
