public class EntityUtil extends Object
| Constructor and Description |
|---|
EntityUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends GenericEntity> |
filterByAnd(List<? extends T> values,
Map<String,?> fields)
returns the values that match the values in fields
|
static <T extends GenericValue> |
filterByAnd(List<T> values,
List<? extends EntityExpr> exprs)
returns the values that match the exprs in list
|
static <T extends GenericEntity> |
filterByDate(List<T> datedValues)
returns the values that are currently active.
|
static <T extends GenericEntity> |
filterByDate(List<T> datedValues,
boolean allAreSame)
returns the values that are currently active.
|
static <T extends GenericEntity> |
filterByDate(List<T> datedValues,
Date moment)
returns the values that are active at the moment.
|
static <T extends GenericEntity> |
filterByDate(List<T> datedValues,
Timestamp moment)
returns the values that are active at the moment.
|
static <T extends GenericEntity> |
filterByDate(List<T> datedValues,
Timestamp moment,
String fromDateName,
String thruDateName,
boolean allAreSame)
returns the values that are active at the moment.
|
static GenericValue |
getFirst(List<? extends GenericValue> values) |
static GenericValue |
getOnly(List<? extends GenericValue> values) |
static List<GenericValue> |
getRelated(String relationName,
List<? extends GenericValue> values) |
static List<GenericValue> |
getRelatedByAnd(String relationName,
Map<String,?> fields,
List<? extends GenericValue> values) |
static List<GenericValue> |
getRelatedCache(String relationName,
List<? extends GenericValue> values) |
static <T extends GenericValue> |
orderBy(List<T> values,
List<String> orderBy)
returns the values in the order specified
|
public static GenericValue getFirst(List<? extends GenericValue> values)
public static GenericValue getOnly(List<? extends GenericValue> values)
public static <T extends GenericEntity> List<T> filterByDate(List<T> datedValues)
datedValues - GenericValue's that have "fromDate" and "thruDate" fieldspublic static <T extends GenericEntity> List<T> filterByDate(List<T> datedValues, boolean allAreSame)
datedValues - GenericValue's that have "fromDate" and "thruDate" fieldsallAreSame - Specifies whether all values in the List are of the same entity; this can help speed things up a fair amount since we only have to see if the from and thru date fields are valid oncepublic static <T extends GenericEntity> List<T> filterByDate(List<T> datedValues, Date moment)
datedValues - GenericValue's that have "fromDate" and "thruDate" fieldsmoment - the moment in questionpublic static <T extends GenericEntity> List<T> filterByDate(List<T> datedValues, Timestamp moment)
datedValues - GenericValue's that have "fromDate" and "thruDate" fieldsmoment - the moment in questionpublic static <T extends GenericEntity> List<T> filterByDate(List<T> datedValues, Timestamp moment, String fromDateName, String thruDateName, boolean allAreSame)
datedValues - GenericValue's that have "fromDate" and "thruDate" fieldsmoment - the moment in questionallAreSame - Specifies whether all values in the List are of the same entity; this can help speed things up a fair amount since we only have to see if the from and thru date fields are valid oncepublic static <T extends GenericEntity> List<T> filterByAnd(List<? extends T> values, Map<String,?> fields)
values - List of GenericValuesfields - the field-name/value pairs that must matchpublic static <T extends GenericValue> List<T> filterByAnd(List<T> values, List<? extends EntityExpr> exprs)
values - List of GenericValuesexprs - the expressions that must validate to truepublic static <T extends GenericValue> List<T> orderBy(List<T> values, List<String> orderBy)
values - List of GenericValuesorder - The fields of the named entity to order the query by;
optionally add a " ASC" for ascending or " DESC" for descendingpublic static List<GenericValue> getRelated(String relationName, List<? extends GenericValue> values) throws GenericEntityException
GenericEntityExceptionpublic static List<GenericValue> getRelatedCache(String relationName, List<? extends GenericValue> values) throws GenericEntityException
GenericEntityExceptionpublic static List<GenericValue> getRelatedByAnd(String relationName, Map<String,?> fields, List<? extends GenericValue> values) throws GenericEntityException
GenericEntityExceptionCopyright © 2016 Atlassian. All rights reserved.