Package com.avoka.fc.core.dao
Class DataUtils
- java.lang.Object
-
- com.avoka.fc.core.dao.DataUtils
-
public class DataUtils extends Object
This class provides utility methods used by DAOs around data manipulation. It is not considered part of the public TM API and may be modified without notice.- Since:
- 4.1.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
PERIOD_TYPE_DAY
The constant indicating that a set of data should be grouped by daystatic String
PERIOD_TYPE_HOUR
The constant indicating that a set of data should be grouped by hour
-
Constructor Summary
Constructors Constructor Description DataUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getTrendDateString(org.apache.cayenne.DataRow dataRow, String periodType)
This method creates a date string used to reference trend data for a specific period.static String
getTrendDateString(org.joda.time.DateTime date, String periodType)
This method creates a date string used to reference trend data for a specific period.
-
-
-
Field Detail
-
PERIOD_TYPE_HOUR
public static final String PERIOD_TYPE_HOUR
The constant indicating that a set of data should be grouped by hour- See Also:
- Constant Field Values
-
PERIOD_TYPE_DAY
public static final String PERIOD_TYPE_DAY
The constant indicating that a set of data should be grouped by day- See Also:
- Constant Field Values
-
-
Method Detail
-
getTrendDateString
public static String getTrendDateString(org.apache.cayenne.DataRow dataRow, String periodType)
This method creates a date string used to reference trend data for a specific period. This method is used internally by DAOs and may be modified without warning. The resulting strings are not suitable for display but merely for providing a value for use as a key in maps and the like. Also note that the year is not used, and so the strings are not suitable for data spanning a year or more.- Parameters:
dataRow
- the data row holding period information in the numeric fields "month", "day" and (if grouping by hour) "hour"periodType
-PERIOD_TYPE_DAY
orPERIOD_TYPE_HOUR
- Returns:
- a string identifying the period for the data row and period type, e.g. "08-22" for day-based data or "08-22-15" for hour-based data corresponding to August 22, 15:00
-
getTrendDateString
public static String getTrendDateString(org.joda.time.DateTime date, String periodType)
This method creates a date string used to reference trend data for a specific period. This method is used internally by DAOs and may be modified without warning. The resulting strings are not suitable for display but merely for providing a value for use as a key in maps and the like. Also note that the year is not used, and so the strings are not suitable for data spanning a year or more.- Parameters:
date
- the date/time holding period informationperiodType
-PERIOD_TYPE_DAY
orPERIOD_TYPE_HOUR
- Returns:
- a string identifying the period for the date and period type, e.g. "08-22" for day-based data or "08-22-15" for hour-based data corresponding to August 22, 15:00
-
-