public class PropertyUtil extends Object
Constructor and Description |
---|
PropertyUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkDistinct(String... propertyValuePairs)
Checks that a set of properties don't share any values.
|
static void |
checkFieldExists(RecordTokenType type,
String propertyName,
List<String> fieldNames)
Checks that the given field name(s) are valid field names in the given record type.
|
static void |
checkFieldExists(RecordTokenType type,
String propertyName,
String... fieldNames)
Checks that the given field name(s) are valid field names in the given record type.
|
static Set<String> |
checkNoDuplicates(String propertyName,
String[] propertyValues)
Checks that a property's array of values contains no duplicates and collects the tested values into a
Set . |
static void |
checkNotEmpty(String propertyName,
Collection<?> propertyValues)
Checks that a property's collection of values is not null or empty.
|
static void |
checkNotEmpty(String propertyName,
Object[] propertyValues)
Checks that a property's array of values is not null or zero-length.
|
static void |
checkNotEmpty(String propertyName,
String propertyValue)
Checks that a property's string value is not null or zero-length.
|
static void |
checkNotNull(String propertyName,
Object propertyValue)
Checks that a property value is not null.
|
static void |
checkNumericMaxValuesByType(String propertyName,
ScalarTokenType outputType,
BigDecimal value)
Checks that a numeric property value is not greater than the allowed maximum value for
the given numeric type, which includes, TokenTypeConstant.INT, DOUBLE, FLOAT, NUMERIC, LONG, MONEY.
|
static void |
checkPropertyGE(String propertyName,
double propertyValue,
double minValue)
Checks that a property value is greater than or equal to a minimum.
|
static void |
checkPropertyGE(String propertyName,
long propertyValue,
long minValue)
Checks that a property value is greater than or equal to a minimum.
|
static void |
checkPropertyGELE(String propertyName,
double propertyValue,
double minValue,
double maxValue)
Checks that a property value is greater than or equal to a minimum and less than or equal to a maximum.
|
static void |
checkPropertyGELE(String propertyName,
long propertyValue,
long minValue,
long maxValue)
Checks that a property value is greater than or equal to a minimum and less than or equal to a maximum.
|
static void |
checkPropertyGT(String propertyName,
double propertyValue,
double minValue)
Checks that a property value is greater than a minimum.
|
static void |
checkPropertyGT(String propertyName,
long propertyValue,
long minValue)
Checks that a property value is greater than a minimum.
|
static void |
checkPropertyLE(String propertyName,
double propertyValue,
double maxValue)
Checks that a property value is less than or equal to a maximum.
|
static void |
checkPropertyLE(String propertyName,
long propertyValue,
long maxValue)
Checks that a property value is less than or equal to a maximum.
|
static void |
checkPropertyLT(String propertyName,
double propertyValue,
double maxValue)
Checks that a property value is less than a maximum.
|
static void |
checkPropertyLT(String propertyName,
long propertyValue,
long maxValue)
Checks that a property value is less than a maximum.
|
static void |
checkSameSize(String primaryName,
Collection<?> primaryCollection,
String secondaryName,
Collection<?> secondaryCollection)
Checks that two collection properties have the same size.
|
static void |
checkSameSize(String primaryName,
Collection<?> primaryCollection,
String secondaryName,
Object secondaryArray)
Checks that a collection and an array property both have the same size.
|
static void |
checkSameSize(String primaryName,
Object primaryArray,
String secondaryName,
Collection<?> secondaryCollection)
Checks that an array and a collection property both have the same size.
|
static void |
checkSameSize(String primaryName,
Object primaryArray,
String secondaryName,
Object secondaryArray)
Checks that two array properties have the same size.
|
static long |
parseByteSizeSpecifier(String propertyName,
String specifier)
Parses the given property as a size in bytes.
|
public static void checkPropertyGE(String propertyName, long propertyValue, long minValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkminValue
- the minimum value allowedcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is less than the minimum allowed value.public static void checkPropertyGE(String propertyName, double propertyValue, double minValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkminValue
- the minimum value rangecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is less than minimum allowed value.public static void checkPropertyGT(String propertyName, long propertyValue, long minValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkminValue
- the minimum value rangecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is less than the minimum allowed value.public static void checkPropertyGT(String propertyName, double propertyValue, double minValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkminValue
- the minimum value allowedcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is less than minimum allowed value.public static void checkPropertyLE(String propertyName, long propertyValue, long maxValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkmaxValue
- the maximum value allowedcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is greater than maximum allowed value.public static void checkPropertyLE(String propertyName, double propertyValue, double maxValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkmaxValue
- the maximum value allowedcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is greater than maximum allowed value.public static void checkNumericMaxValuesByType(String propertyName, ScalarTokenType outputType, BigDecimal value)
propertyName
- the name of the numeric propertyoutputType
- the type of the propertyvalue
- the value of the property wrapped as a BigDecimal
.public static void checkPropertyLT(String propertyName, long propertyValue, long maxValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkmaxValue
- the upper range valuecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is not less than an upper range.public static void checkPropertyLT(String propertyName, double propertyValue, double maxValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkmaxValue
- the upper range valuecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is not less than an upper range.public static void checkPropertyGELE(String propertyName, long propertyValue, long minValue, long maxValue)
This is a convenience method which combines checkPropertyGE(String, long, long)
and
checkPropertyLE(String, long, long)
.
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkminValue
- the minimum value allowedmaxValue
- the maximum value allowedcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is outside the specified range.public static void checkPropertyGELE(String propertyName, double propertyValue, double minValue, double maxValue)
This is a convenience method which combines checkPropertyGE(String, double, double)
and
checkPropertyLE(String, double, double)
.
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkminValue
- the minimum value allowedmaxValue
- the maximum value allowedcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is outside the specified range.public static void checkNotNull(String propertyName, Object propertyValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property value to checkcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValue
is null.public static void checkNotEmpty(String propertyName, String propertyValue)
propertyName
- the name of the property, used in any generated error messagespropertyValue
- the property valuecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValues
is null or zero-length.public static void checkNotEmpty(String propertyName, Object[] propertyValues)
propertyName
- the name of the property, used in any generated error messagespropertyValues
- the property array to checkcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValues
is null or zero-length.public static void checkDistinct(String... propertyValuePairs)
propertyValuePairs
- Pairs of properties and their values [property1,value1,property2,value2,...].public static Set<String> checkNoDuplicates(String propertyName, String[] propertyValues)
Set
.propertyName
- the name of the property, used in any generated error messagespropertyValues
- the property array to checkpropertyValues
com.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValues
contains duplicates.public static void checkSameSize(String primaryName, Collection<?> primaryCollection, String secondaryName, Collection<?> secondaryCollection)
primaryName
- the first collection property's nameprimaryCollection
- the first collection property's valuesecondaryName
- the second collection property's namesecondaryCollection
- the second collection property's valuecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if properties have different number of elements.public static void checkSameSize(String primaryName, Object primaryArray, String secondaryName, Object secondaryArray)
primaryName
- the first array property's nameprimaryArray
- the first array property's valuesecondaryName
- the second array property's namesecondaryArray
- the second array property's valuecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if properties have different number of elements.public static void checkSameSize(String primaryName, Collection<?> primaryCollection, String secondaryName, Object secondaryArray)
primaryName
- the collection property's nameprimaryCollection
- the collection property's valuesecondaryName
- the array property's namesecondaryArray
- the array property's valuecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if properties have different number of elements.public static void checkSameSize(String primaryName, Object primaryArray, String secondaryName, Collection<?> secondaryCollection)
primaryName
- the array property's nameprimaryArray
- the array property's valuesecondaryName
- the collection property's namesecondaryCollection
- the collection property's valuecom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if properties have different number of elements.public static void checkNotEmpty(String propertyName, Collection<?> propertyValues)
propertyName
- the name of the property, used in any generated error messagespropertyValues
- the property collection to checkcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if propertyValues
is null or empty.public static void checkFieldExists(RecordTokenType type, String propertyName, String... fieldNames)
InvalidPropertyValueException
.type
- the record type to checkpropertyName
- name of the property containing the field namesfieldNames
- field names to verify existcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- thrown if any of the given field names are invalidpublic static void checkFieldExists(RecordTokenType type, String propertyName, List<String> fieldNames)
InvalidPropertyValueException
.type
- the record type to checkpropertyName
- name of the property containing the field namesfieldNames
- field names to verify existcom.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- thrown if any of the given field names are invalidpublic static long parseByteSizeSpecifier(String propertyName, String specifier)
propertyName
- the name of the property, used for error handlingspecifier
- the specifier. for example "100M"com.pervasive.datarush.graphs.physical.InvalidPropertyValueException
- if the size specifier cannot be parsed or specifies a
negative size.Copyright © 2024 Actian Corporation. All rights reserved.