Example usage for java.util Map values

List of usage examples for java.util Map values

Introduction

In this page you can find the example usage for java.util Map values.

Prototype

Collection<V> values();

Source Link

Document

Returns a Collection view of the values contained in this map.

Usage

From source file:org.kee.ssf.service.sys.PrivilegeService.java

/**
 * ???./*from  w ww . ja v a  2  s .com*/
 */
private Specification<Privilege> buildSpecification(Map<String, Object> searchParams) {
    Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
    Specification<Privilege> spec = DynamicSpecifications.bySearchFilter(filters.values(), Privilege.class);
    return spec;
}

From source file:com.hubspot.jinjava.lib.filter.Filter.java

default Object filter(Object var, JinjavaInterpreter interpreter, Object[] args, Map<String, Object> kwargs) {
    // We append the named arguments at the end of the positional ones
    Object[] allArgs = ArrayUtils.addAll(args, kwargs.values().toArray());
    String[] stringArgs = Arrays.stream(allArgs).map(arg -> Objects.toString(arg, null)).toArray(String[]::new);

    return filter(var, interpreter, stringArgs);
}

From source file:com.reactivetechnologies.platform.datagrid.store.ModelPersistenceStore.java

@Override
public void storeAll(Map<Long, RegressionModel> map) {
    if (map != null && !map.isEmpty()) {
        for (RegressionModel r : map.values()) {
            repository.save(r);/*from w w  w  .  j  a v  a2  s.c  o m*/
        }
    }

}

From source file:org.apache.karaf.webconsole.cxf.internal.DefaultBusFinder.java

private Collection<Bus> findSpringBus(ServiceReference reference) {
    ApplicationContext appContext = (ApplicationContext) context.getService(reference);

    Map<String, Bus> contextBuses = appContext.getBeansOfType(Bus.class);

    context.ungetService(reference);/*  w  w  w .j  a v a2s  .c o  m*/
    return contextBuses.values();
}

From source file:org.kee.ssf.service.role.RoleService.java

/**
 * ???.//from  w  w  w.j  a  va2  s . co m
 */
private Specification<Role> buildSpecification(Map<String, Object> searchParams) {
    Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
    Specification<Role> spec = DynamicSpecifications.bySearchFilter(filters.values(), Role.class);
    return spec;
}

From source file:com.cronutils.mapper.CronMapper.java

private static Function<Cron, Cron> setQuestionMark() {
    return cron -> {
        CronField dow = cron.retrieve(CronFieldName.DAY_OF_WEEK);
        CronField dom = cron.retrieve(CronFieldName.DAY_OF_MONTH);
        if (dow != null && dom != null) {
            if (dow.getExpression() instanceof QuestionMark || dom.getExpression() instanceof QuestionMark) {
                return cron;
            } else {
                Map<CronFieldName, CronField> fields = Maps.newHashMap();
                fields.putAll(cron.retrieveFieldsAsMap());
                if (dow.getExpression() instanceof Always) {
                    fields.put(CronFieldName.DAY_OF_WEEK, new CronField(CronFieldName.DAY_OF_WEEK,
                            new QuestionMark(), fields.get(CronFieldName.DAY_OF_WEEK).getConstraints()));
                } else {
                    if (dom.getExpression() instanceof Always) {
                        fields.put(CronFieldName.DAY_OF_MONTH, new CronField(CronFieldName.DAY_OF_MONTH,
                                new QuestionMark(), fields.get(CronFieldName.DAY_OF_MONTH).getConstraints()));
                    } else {
                        cron.validate();
                    }/*from   ww w .  java 2s .  c o  m*/
                }
                return new Cron(cron.getCronDefinition(), Lists.<CronField>newArrayList(fields.values()));
            }
        }
        return cron;
    };
}

From source file:com.oakhole.sms.service.SmsService.java

public Page<Sms> findAll(Map<String, Object> searchParams, int pageNumber, int pageSize, String sortDirection,
        String sortBy) {// w  w  w . j  a v  a  2s  . co m
    Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
    Specification<Sms> spec = DynamicSpecifications.bySearchFilter(filters.values(), Sms.class);
    Sort sort = new Sort("ASC".equals(sortDirection) ? Sort.Direction.ASC : Sort.Direction.DESC, sortBy);
    PageRequest pageRequest = new PageRequest(pageNumber, pageSize, sort);
    Page<Sms> smsList = smsDao.findAll(spec, pageRequest);
    return smsList;
}

From source file:com.oakhole.auth.service.FileService.java

public Page<File> findAll(Map<String, Object> searchParams, int pageNumber, int pageSize, String sortDirection,
        String sortBy) {/*  w w  w  .  j av a  2 s  .c om*/
    Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
    Specification<File> spec = DynamicSpecifications.bySearchFilter(filters.values(), File.class);
    Sort sort = new Sort("ASC".equals(sortDirection) ? Sort.Direction.ASC : Sort.Direction.DESC, sortBy);
    PageRequest pageRequest = new PageRequest(pageNumber, pageSize, sort);
    Page<File> fileList = fileDao.findAll(spec, pageRequest);
    return fileList;
}

From source file:com.oakhole.auth.service.MenuService.java

public Page<Menu> findAll(Map<String, Object> searchParams, int pageNumber, int pageSize, String sortDirection,
        String sortBy) {//from www . j a v  a 2 s .  c  o m
    Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
    Specification<Menu> spec = DynamicSpecifications.bySearchFilter(filters.values(), Menu.class);
    Sort sort = new Sort("ASC".equals(sortDirection) ? Sort.Direction.ASC : Sort.Direction.DESC, sortBy);
    PageRequest pageRequest = new PageRequest(pageNumber, pageSize, sort);
    Page<Menu> menuList = menuDao.findAll(spec, pageRequest);
    return menuList;
}

From source file:com.oakhole.auth.service.PermService.java

public Page<Perm> findAll(Map<String, Object> searchParams, int pageNumber, int pageSize, String sortDirection,
        String sortBy) {/*from w ww.ja  v  a 2 s . c o m*/
    Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
    Specification<Perm> spec = DynamicSpecifications.bySearchFilter(filters.values(), Perm.class);
    Sort sort = new Sort("ASC".equals(sortDirection) ? Sort.Direction.ASC : Sort.Direction.DESC, sortBy);
    PageRequest pageRequest = new PageRequest(pageNumber, pageSize, sort);
    Page<Perm> permList = permDao.findAll(spec, pageRequest);
    return permList;
}