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:gemlite.core.internal.context.registryClass.ViewItemRegistry.java

@Override
public void cleanAll() {
    GemliteViewContext context = GemliteViewContext.getInstance();
    Map<String, ViewItem> viewMap = context.getViewContext();
    if (viewMap != null && viewMap.values() != null && viewMap.values().size() > 0) {
        Iterator<ViewItem> iters = viewMap.values().iterator();
        while (iters.hasNext()) {
            ViewItem item = iters.next();
            if (item != null) {
                context.removeViewItem(item.getName());
            }//from w w w . j a  v a  2  s  . c  o  m
        }
    }
}

From source file:de.christian_klisch.software.servercontrol.web.WebAction.java

@RequestMapping(value = "/json", method = RequestMethod.GET)
public @ResponseBody Object[] getJSON(@RequestParam(value = "process", required = false) String process) {
    Map<String, InfoTask> map = application.getAllProcessesHTML();
    if (map != null)
        return map.values().toArray();
    return null;/*  w ww  .j  av  a  2s. c  o  m*/
}

From source file:org.github.aenygmatic.payroll.domain.annotations.postprocessing.CustomEnumAnnotationPostProcessor.java

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory)
        throws BeansException {
    Map<String, Object> map = configurableListableBeanFactory.getBeansWithAnnotation(annotationType());
    for (Object bean : map.values()) {
        registerCustomBeans(configurableListableBeanFactory, bean);
    }/*from  www .j  a  va 2  s. com*/

}

From source file:jenkins.metrics.api.MetricsRootAction.java

/**
 * Utility method to check if health check results are all reporting healthy.
 *
 * @param results the results./*  w  w w.  j  ava 2 s. c om*/
 * @return {@code true} if all are healthy.
 */
private static boolean isAllHealthy(Map<String, HealthCheck.Result> results) {
    for (HealthCheck.Result result : results.values()) {
        if (!result.isHealthy()) {
            return false;
        }
    }
    return true;
}

From source file:com.nec.strudel.entity.key.CompoundKeyFinder.java

public CompoundKeyFinder(Class<?> idClass, Map<String, Method> getters) {
    this.idClass = idClass;
    this.getters = getters;
    this.valueClass = getters.values().iterator().next().getDeclaringClass();
}

From source file:com.aw.core.dao.AWQueryRunner.java

public Object findUniqueValue(Connection con, String sql, Object[] filterKeys) {
    Map map = findUniqueMap(con, sql, filterKeys);
    Iterator iter = map.values().iterator();
    return iter.hasNext() ? iter.next() : null;
}

From source file:org.mule.ibeans.spring.IBeanInjectorsBeanPostProcessor.java

public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    Map beans = applicationContext.getBeansOfType(IBeansContext.class);
    IBeansContext ctx = (IBeansContext) beans.values().iterator().next();
    muleContext = (MuleContext) ctx.getConfig().get(MuleContext.class.getName());
    injectDelegate = new InjectAnnotationProcessor(muleContext);
    applicationAnnotationsProcessor = new AnnotatedServiceObjectProcessor(muleContext);
}

From source file:edu.northwestern.bioinformatics.studycalendar.test.restfulapi.ConfigurationInitializer.java

private void oneTimeSetup(ConnectionSource connectionSource, String table) {
    Map<String, String> desiredConfigProps = (Map<String, String>) configurations.get(table);

    List<Map<String, Object>> currentPropRows = connectionSource.currentJdbcTemplate()
            .queryForList("SELECT prop FROM " + table);
    List<String> existingProps = new ArrayList<String>(currentPropRows.size());
    for (Map<String, Object> row : currentPropRows)
        existingProps.add(row.values().iterator().next().toString());

    for (String prop : desiredConfigProps.keySet()) {
        String desiredValue = desiredConfigProps.get(prop);
        if (existingProps.contains(prop)) {
            log.debug("Already a record for {} in {}; updating", prop, table);
            connectionSource.currentJdbcTemplate()
                    .update(String.format("UPDATE %s SET value=? WHERE prop=?", table), desiredValue, prop);
            existingProps.remove(prop);//from w  w w  .  ja  va  2  s.co  m
        } else {
            log.debug("No record for {} in {}; inserting", prop, table);
            connectionSource.currentJdbcTemplate().update(
                    String.format("INSERT INTO %s (prop, value) VALUES (?, ?)", table), prop, desiredValue);
        }
    }
    // remaining contents of existingProps are not referenced in the config data, so should be deleted
    deleteConfigurationProperties(connectionSource, table, existingProps);
}

From source file:fr.esiea.esieaddress.dao.implementation.DatabaseMock.java

public Contact getOneByEmail(String collectionId, String mail) {
    if (!database.containsKey(collectionId))
        return null;
    Map<String, Contact> contactMap = database.get(collectionId);

    for (Contact contact : contactMap.values()) {
        if (contact.getEmail() != null && contact.getEmail().equals(mail))
            return contact;
    }//from   www .j  a  va2 s .  c om
    return null;
}

From source file:org.obiba.onyx.engine.variable.impl.CaptureAndExportStrategyMapFactoryBean.java

@SuppressWarnings("unchecked")
public Object getObject() throws Exception {
    if (strategyMap == null) {
        strategyMap = new HashMap<String, CaptureAndExportStrategy>();

        Map strategies = applicationContext.getBeansOfType(CaptureAndExportStrategy.class);
        for (Object value : strategies.values()) {
            CaptureAndExportStrategy strategy = (CaptureAndExportStrategy) value;
            strategyMap.put(strategy.getEntityType(), strategy);
        }//from w w  w .  j av  a 2s .com
    }
    return strategyMap;
}