Search in sources :

Example 1 with RangerBaseModelObject

use of org.apache.ranger.plugin.model.RangerBaseModelObject in project ranger by apache.

the class AbstractPredicateUtil method applyFilter.

public void applyFilter(List<? extends RangerBaseModelObject> objList, SearchFilter filter) {
    if (CollectionUtils.isEmpty(objList)) {
        return;
    }
    Predicate pred = getPredicate(filter);
    if (pred != null) {
        CollectionUtils.filter(objList, pred);
    }
    Comparator<RangerBaseModelObject> sorter = getSorter(filter);
    if (sorter != null) {
        Collections.sort(objList, sorter);
    }
}
Also used : RangerBaseModelObject(org.apache.ranger.plugin.model.RangerBaseModelObject) Predicate(org.apache.commons.collections.Predicate)

Example 2 with RangerBaseModelObject

use of org.apache.ranger.plugin.model.RangerBaseModelObject in project ranger by apache.

the class ServiceUtil method dataObjectToRangerObject.

private RangerBaseModelObject dataObjectToRangerObject(VXDataObject dataObject, RangerBaseModelObject rangerObject) {
    RangerBaseModelObject ret = rangerObject;
    ret.setId(dataObject.getId());
    ret.setCreateTime(dataObject.getCreateDate());
    ret.setUpdateTime(dataObject.getUpdateDate());
    ret.setCreatedBy(dataObject.getOwner());
    ret.setUpdatedBy(dataObject.getUpdatedBy());
    return ret;
}
Also used : RangerBaseModelObject(org.apache.ranger.plugin.model.RangerBaseModelObject)

Aggregations

RangerBaseModelObject (org.apache.ranger.plugin.model.RangerBaseModelObject)2 Predicate (org.apache.commons.collections.Predicate)1