public class Util extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayContainsString(String[] array,
String str)
Determines if the specified
String array contains the specified string. |
static void |
clearTime(Calendar calendar)
Clears the time information by setting it back to midnight.
|
static long |
createTimeStamp(Calendar cal)
Creates a timestamp (format: yyyymmddhhmmss) from the specified
Calendar, |
static boolean |
equalsNullAware(Object obj1,
Object obj2)
Compares two objects by their respective
Object.equals(java.lang.Object) methods. |
static String |
getChartIdFromRequest(SlingHttpServletRequest req)
Gets a chart id for rendering from the specified request, if applicable.
|
static String |
getChartLayoutFromRequest(SlingHttpServletRequest req)
Determines a provided chart layout from the specified request, if applicable.
|
static Integer[] |
getRenderSizeFromRequest(SlingHttpServletRequest req)
Determines a predefines size from the specified request, if applicable.
|
static String |
getRenderTypeFromRequest(SlingHttpServletRequest req)
Gets the render type from the reuest.
|
static boolean |
isSingleViewRendering(SlingHttpServletRequest req)
Checks if the specified request triggers a single view rendering.
|
static void |
writeToJSON(JSONWriter writer,
com.day.cq.reporting.impl.snapshots.AggregationInterval interval,
Calendar cal,
TimeZone timeZone,
Locale locale)
Writes the specified
Calendar to the specified JSONWriter. |
public static long createTimeStamp(Calendar cal)
Calendar,cal - The calendarpublic static void writeToJSON(JSONWriter writer, com.day.cq.reporting.impl.snapshots.AggregationInterval interval, Calendar cal, TimeZone timeZone, Locale locale) throws JSONException
Calendar to the specified JSONWriter.writer - The writerinterval - The aggregation interval to create display values forcal - The calendartimeZone - The time zonelocale - The localeJSONException - if writing data failedpublic static void clearTime(Calendar calendar)
calendar - The calendar to clear time information frompublic static boolean arrayContainsString(String[] array, String str)
String array contains the specified string.array - The arraystr - The stringtrue if the array contains the given stringpublic static String getRenderTypeFromRequest(SlingHttpServletRequest req)
req - The request to determine the render type fromConst.RENDER_TYPE_TABULAR or
Const.RENDER_TYPE_CHART; null for rendering the
chart in default modepublic static String getChartIdFromRequest(SlingHttpServletRequest req)
req - The requestnull if no chart id is available/requiredpublic static boolean isSingleViewRendering(SlingHttpServletRequest req)
req - The request to be analyzedtrue if a single view rendering is triggered by the requestpublic static Integer[] getRenderSizeFromRequest(SlingHttpServletRequest req)
req - The requestnull,
indicating that the respective dimension has to be autocalculatedpublic static String getChartLayoutFromRequest(SlingHttpServletRequest req)
req - The requestnull (if no
chart layout was provided)public static boolean equalsNullAware(Object obj1, Object obj2)
Compares two objects by their respective Object.equals(java.lang.Object) methods. Both objects
may be null.
obj1 - The first objectobj2 - The second objecttrue if both objects are equalCopyright © 2010 - 2020 Adobe. All Rights Reserved