public final class FormatDataPolicy extends Object
Modifier and Type | Method and Description |
---|---|
static String |
formatDateValue(com.orchestranetworks.schema.SchemaTypeName typeName,
Date date)
Returns the displaying format of a date instance by specifying a schema type name and a locale.
|
static String |
formatIntervalValue(IntervalType intervalType,
BigDecimal number)
Returns the interval format of a big decimal instance by specifying an interval type.
|
static String |
formatIntervalValue(IntervalType intervalType,
BigDecimal number,
Locale locale)
Returns the interval format of a big decimal instance by specifying an interval type and a locale.
|
static String[] |
formatIntervalValueForDashboardTile(IntervalType intervalType,
BigDecimal number,
Locale locale) |
static String |
formatNumeric(com.orchestranetworks.schema.SchemaTypeName schemaTypeName,
Number number)
Returns the displaying format of a number by specifying a schema type name.
|
static String |
formatParameterValue(Object value,
com.orchestranetworks.schema.SchemaTypeName dataType,
String valueFormat,
com.orchestranetworks.service.Session session) |
static String |
formatPercentageValue(BigDecimal number)
Returns the percentage format of a big decimal instance using the default locale.
|
static String |
formatPercentageValue(BigDecimal number,
Locale locale)
Returns the percentage format of a big decimal instance by specifying a locale.
|
static String |
formatValue(com.orchestranetworks.schema.SchemaTypeName typeName,
Object value,
Locale locale)
Returns the displaying format of an object by specifying a schema type name and a locale.
|
static boolean |
isDateOnly(Date date)
Returns
true if the date instance doesn't carry the time part. |
static Date |
parseDate(DataTypeFormat dataTypeFormat,
String value)
Returns a date instance from a string value by specifying a
DataTypeFormat . |
static Date |
parseDate(com.orchestranetworks.schema.SchemaTypeName typeName,
String value)
Returns a date instance from a string value by specifying a schema type name.
|
static BigDecimal |
parseNumeric(com.orchestranetworks.schema.SchemaTypeName schemaTypeName,
String value)
Returns a big decimal instance of a string value by specifying a schema type name.
|
static void |
validValueInRange(com.orchestranetworks.schema.SchemaTypeName typeName,
String min,
String max,
String value)
Validates a value against a range by specifying a schema type name.
|
public static String formatValue(com.orchestranetworks.schema.SchemaTypeName typeName, Object value, Locale locale)
public static String formatDateValue(com.orchestranetworks.schema.SchemaTypeName typeName, Date date)
IllegalArgumentException
- if the schema type is not a date type.DataTypeFormat.isDateType()
public static Date parseDate(com.orchestranetworks.schema.SchemaTypeName typeName, String value) throws DQIdException
IllegalArgumentException
- if the schema type is not a date type.DQIdException
DataTypeFormat.isDateType()
,
parseDate(DataTypeFormat, String)
public static Date parseDate(DataTypeFormat dataTypeFormat, String value) throws DQIdException
DataTypeFormat
.DQIdException
- if the date format is invalid.DataTypeFormat
public static boolean isDateOnly(Date date)
true
if the date instance doesn't carry the time part.public static String formatNumeric(com.orchestranetworks.schema.SchemaTypeName schemaTypeName, Number number)
IllegalArgumentException
- if the schema type is not a numeric type.DataTypeFormat.isNumeric()
public static BigDecimal parseNumeric(com.orchestranetworks.schema.SchemaTypeName schemaTypeName, String value)
IllegalArgumentException
- if the schema type is not a numeric type.DataTypeFormat.isNumeric()
public static String formatPercentageValue(BigDecimal number)
public static String formatPercentageValue(BigDecimal number, Locale locale)
public static String formatIntervalValue(IntervalType intervalType, BigDecimal number)
IllegalArgumentException
- if the interval type is null
.public static String formatIntervalValue(IntervalType intervalType, BigDecimal number, Locale locale)
IllegalArgumentException
- if the interval type is null
.public static String[] formatIntervalValueForDashboardTile(IntervalType intervalType, BigDecimal number, Locale locale)
public static void validValueInRange(com.orchestranetworks.schema.SchemaTypeName typeName, String min, String max, String value) throws DQIdException
IllegalArgumentException
- if the schema type is neither a numeric type nor a date type.DQIdException
DataTypeFormat.isNumeric()
,
DataTypeFormat.isDateType()