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:com.oakhole.sms.service.SmsReceiveService.java

public Page<SmsReceive> findAll(Map<String, Object> searchParams, int pageNumber, int pageSize,
        String sortDirection, String sortBy) {
    Map<String, SearchFilter> filters = SearchFilter.parse(searchParams);
    Specification<SmsReceive> spec = DynamicSpecifications.bySearchFilter(filters.values(), SmsReceive.class);
    Sort sort = new Sort("ASC".equals(sortDirection) ? Sort.Direction.ASC : Sort.Direction.DESC, sortBy);
    PageRequest pageRequest = new PageRequest(pageNumber, pageSize, sort);
    Page<SmsReceive> smsReceiveList = smsReceiveDao.findAll(spec, pageRequest);
    return smsReceiveList;
}

From source file:io.neba.core.resourcemodels.mapping.CyclicMappingSupport.java

/**
 * The ordered map of mappings also represents the mapping stack, i.e.
 * the depth of the current branch of the mapping tree.
 * The topmost mapping (root) thus contains a mapping with
 * a depth equal to the length of the ongoing mappings. This information is provided to the
 * {@link io.neba.core.resourcemodels.metadata.ResourceModelStatistics}.
 *//*from w w w.  j  a va  2s  . c om*/
private void trackDepths(Map<Mapping, Mapping> ongoingMappings) {
    int depth = ongoingMappings.size();
    for (Mapping ongoing : ongoingMappings.values()) {
        ongoing.getMetadata().getStatistics().countMappings(depth--);
    }
}

From source file:gridool.db.helpers.GridDbUtils.java

/**
 * @return column position is not provided in the returning foreign keys
 */// w  ww  . j  a v a  2s  .c o  m
@Nonnull
public static Collection<ForeignKey> getExportedKeys(@Nonnull final Connection conn,
        @Nullable final String pkTableName, final boolean setColumnPositions) throws SQLException {
    DatabaseMetaData metadata = conn.getMetaData();
    String catalog = conn.getCatalog();
    final Map<String, ForeignKey> mapping = new HashMap<String, ForeignKey>(4);
    final ResultSet rs = metadata.getExportedKeys(catalog, null, pkTableName);
    try {
        while (rs.next()) {
            final String fkName = rs.getString("FK_NAME");
            ForeignKey fk = mapping.get(fkName);
            if (fk == null) {
                String fkTableName = rs.getString("FKTABLE_NAME");
                fk = new ForeignKey(fkName, fkTableName, pkTableName);
                mapping.put(fkName, fk);
            }
            fk.addColumn(rs, metadata);
        }
    } finally {
        rs.close();
    }
    final Collection<ForeignKey> fkeys = mapping.values();
    if (setColumnPositions) {
        for (ForeignKey fk : fkeys) {
            fk.setColumnPositions(metadata);
        }
    }
    return fkeys;
}

From source file:net.duckling.ddl.web.controller.UserNoticeCountController.java

private int getTotalCount(Map<Integer, Integer> countMap) {
    int totalCount = 0;
    for (Integer count : countMap.values()) {
        totalCount += count;/*from  w w w . ja  v  a2  s. c om*/
    }
    return totalCount;
}

From source file:com.rvantwisk.cnctools.IndexerAppConfiguration.java

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
    Map<String, Object> beansWithAnnotation = beanFactory.getBeansWithAnnotation(Task.class);
    Collection operations = beansWithAnnotation.values();
    System.out.println("Registering the following operations:");
    for (Object operation : operations) {
        AbstractTask op = (AbstractTask) operation;
        allOperations.add(op);//from   w  w  w.  j  a  v a  2s . com
        System.out.println(op.getName());
    }
    System.out.println("- done");
}

From source file:me.springframework.di.spring.SinkAugmentation.java

public void augment(MutableContext context) {
    Map<String, MutableInstance> instances = context.getInstances();
    for (MutableInstance instance : instances.values()) {
        attribute(instance, context);//  www. j a va  2 s. c o  m
    }
}

From source file:org.obiba.onyx.engine.ModuleRegistrationListener.java

private boolean existsDependenciesOnConclusion(Map<String, Module> modules, Stage conclusion) {
    for (Module module : modules.values()) {
        for (Stage stage : module.getStages()) {
            if (stage.equals(conclusion))
                continue;
            if (stage.getStageDependencyCondition() != null
                    && stage.getStageDependencyCondition().isDependentOn(conclusion, conclusion.getName()))
                return true;
        }//from   ww  w.j  a v  a2 s .c o m
    }
    return false;
}

From source file:com.bluecloud.ioc.core.KernelComponentDeployer.java

/**
 * //from  w  w w. j a  va  2  s .  c o m
 * @param compositeMetadata
 * @param builder
 */
private void deploy(final CompositeMetadata compositeMetadata, ComponentBuilder builder) {
    Map<String, ComponentMetadata> components = compositeMetadata.getComponentMetadatas();
    for (ComponentMetadata componentMetadata : components.values()) {
        try {
            builder.build(new ComponentObject(componentMetadata), components);
        } catch (KernelComponentBuilderException e) {
            if (log.isErrorEnabled()) {
                log.error("Component" + componentMetadata.getName() + "", e);
            }
        }
    }
}

From source file:com.athena.peacock.controller.common.core.SystemInitializer.java

@PostConstruct
public void init() {
    if (context == null) {
        context = AppContext.getApplicationContext();
    }/*from   w ww . jav  a 2s  .  com*/

    Map<String, InitializingTask> beans = context.getBeansOfType(InitializingTask.class);
    this.initTasks = new ArrayList<InitializingTask>(beans.values());
}

From source file:ro.zg.netcell.connectors.HttpConnectionManager.java

private void initHttpClient() {
    ConfigurationData cfgData = dataSourceDefinition.getConfigData();

    HttpParams params = new BasicHttpParams();
    ConnManagerParams.setMaxTotalConnections(params, Integer
            .parseInt(cfgData.getParameterValue(DataSourceConfigParameters.MAX_TOTAL_CONNECTIONS).toString()));
    ConnPerRouteBean connPerRoute = new ConnPerRouteBean(10);
    HttpHost localhost = new HttpHost("locahost", 80);
    connPerRoute.setMaxForRoute(new HttpRoute(localhost), 50);
    ConnManagerParams.setMaxConnectionsPerRoute(params, connPerRoute);
    ConnManagerParams.setTimeout(params, Long
            .parseLong(cfgData.getParameterValue(DataSourceConfigParameters.CONNECTION_TIMEOUT).toString()));

    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
    schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));

    ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry);

    /* set config params */
    ConfigurationData configData = dataSourceDefinition.getConfigData();
    Map<String, UserInputParameter> userInputParams = configData.getUserInputParams();
    for (UserInputParameter uip : userInputParams.values()) {
        params.setParameter(uip.getInnerName(), uip.getValue());
    }//from   w  w  w .  ja  va2 s .c  om

    HttpConnectionParams.setSoTimeout(params, 25000);
    httpClient = new DefaultHttpClient(cm, params);

}