public class StandardGranularityParser extends Object implements GranularityParser
Constructor and Description |
---|
StandardGranularityParser()
Constructor.
|
StandardGranularityParser(GranularityDictionary dictionary)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static GranularityDictionary |
getDefaultGrainMap()
This method loads default grains and can be extended to add customer grain extensions.
|
Granularity |
parseGranularity(String granularityName)
Parse a granularity from a string.
|
Granularity |
parseGranularity(String granularityName,
org.joda.time.DateTimeZone dateTimeZone)
Parse a granularity from a string and time zone.
|
@Inject public StandardGranularityParser(GranularityDictionary dictionary)
dictionary
- a dictionary containing names mapped to granularitiespublic StandardGranularityParser()
Use a default grain map with the enum name()s and the all granularity.
public static GranularityDictionary getDefaultGrainMap()
public Granularity parseGranularity(String granularityName, org.joda.time.DateTimeZone dateTimeZone) throws GranularityParseException
GranularityParser
parseGranularity
in interface GranularityParser
granularityName
- The name of the granularity being parseddateTimeZone
- The time zone to associate with the resulting granularityGranularityParseException
- if no granularity can be parsed from this namepublic Granularity parseGranularity(String granularityName) throws GranularityParseException
GranularityParser
parseGranularity
in interface GranularityParser
granularityName
- The name of the granularity being parsedGranularityParseException
- if no granularity can be parsed from this granularityCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.