Example usage for com.google.common.collect Maps newHashMap

List of usage examples for com.google.common.collect Maps newHashMap

Introduction

In this page you can find the example usage for com.google.common.collect Maps newHashMap.

Prototype

public static <K, V> HashMap<K, V> newHashMap() 

Source Link

Document

Creates a mutable, empty HashMap instance.

Usage

From source file:org.seedstack.seed.mail.internal.PropertyFileSessionConfigurer.java

@Override
public Map<String, Session> doConfigure() {
    Map<String, Session> sessions = Maps.newHashMap();
    String mailProviders[] = configuration.getStringArray("providers");

    if (mailProviders != null) {
        for (String provider : mailProviders) {
            Configuration mailProviderConfig = configuration
                    .subset(String.format("provider.%s.property", provider));

            Properties mailProviderProperties = new Properties();
            Iterator<String> keys = mailProviderConfig.getKeys();
            while (keys.hasNext()) {
                String configuredProperty = keys.next();
                mailProviderProperties.put(configuredProperty,
                        mailProviderConfig.getProperty(configuredProperty));
            }//from w  ww  .  j  a  va 2  s .  c  o m

            Session session = Session.getInstance(mailProviderProperties);
            sessions.put(provider, session);
        }
    }

    return sessions;
}

From source file:com.cronutils.mapper.format.MDYDateTimeFormatLocaleStrategy.java

private void initDayOfWeekMap() {
    dayOfWeek = Maps.newHashMap();
    dayOfWeek.put("sunday", "EEEE");
    dayOfWeek.put("sun", "E");
    dayOfWeek.put("saturday", "EEEE");
    dayOfWeek.put("sat", "E");
    dayOfWeek.put("friday", "EEEE");
    dayOfWeek.put("fri", "E");
    dayOfWeek.put("thursday", "EEEE");
    dayOfWeek.put("thu", "E");
    dayOfWeek.put("wednesday", "EEEE");
    dayOfWeek.put("wed", "E");
    dayOfWeek.put("tuesday", "EEEE");
    dayOfWeek.put("tue", "E");
    dayOfWeek.put("monday", "EEEE");
    dayOfWeek.put("mon", "E");
}

From source file:com.jivesoftware.sdk.event.AbstractEvent.java

protected AbstractEvent() {
    this.data = Maps.newHashMap();
}

From source file:org.apache.isis.viewer.wicket.model.util.ObjectAssociations.java

public static Map<String, List<ObjectAssociation>> groupByMemberOrderName(
        List<ObjectAssociation> associations) {
    Map<String, List<ObjectAssociation>> associationsByGroup = Maps.newHashMap();
    for (ObjectAssociation association : associations) {
        addAssociationIntoGroup(associationsByGroup, association);
    }//from w w  w  . j a v  a  2 s  .co m
    return associationsByGroup;
}

From source file:interactivespaces.master.api.messages.MasterApiMessageSupport.java

/**
 * Get a failure Master API response./*from   w w  w.j  a  v  a2  s  . co  m*/
 *
 * @param reason
 *          the reason for the failure
 *
 * @return the Master API response object
 */
public static Map<String, Object> getFailureResponse(String reason) {
    Map<String, Object> result = Maps.newHashMap();
    result.put(MasterApiMessages.MASTER_API_MESSAGE_ENVELOPE_RESULT,
            MasterApiMessages.MASTER_API_RESULT_FAILURE);
    result.put(MasterApiMessages.MASTER_API_MESSAGE_ENVELOPE_REASON, reason);

    return result;
}

From source file:com.netflix.genie.GenieWeb.java

protected static Map<String, Object> getDefaultProperties() {
    final Map<String, Object> defaultProperties = Maps.newHashMap();
    defaultProperties.put(SPRING_CONFIG_LOCATION, USER_HOME_GENIE);
    return defaultProperties;
}

From source file:net.t7seven7t.viewit.replacer.Replacers.java

public static List<String> replace(Player target, Player recipient, List<String> messages) {
    final Map<Replacer, String> replaceResults = Maps.newHashMap();
    final List<String> result = Lists.newArrayList();
    messages.forEach(message -> result.add(replace(target, recipient, message, replaceResults)));
    if (Dependency.PlaceholderAPI.isPresent()) {
        return PlaceholderAPI.setPlaceholders(target, result);
    }/*w  w  w.  j  a va 2 s. c  o  m*/
    return result;
}

From source file:org.jetbrains.jet.buildergen.dataholder.DataHolderImpl.java

private Map<DataHolderKey<? super T, ?>, Object> getMap() {
    if (map == null) {
        map = Maps.newHashMap();
    }
    return map;
}

From source file:org.geogit.storage.sqlite.ShortestPathWalker.java

ShortestPathWalker(ObjectId start, ObjectId end, SQLiteGraphDatabase<T> graph, T cx) {
    this.start = start;
    this.end = end;
    this.graph = graph;
    this.cx = cx;

    nodes = Maps.newHashMap();
    q = new PriorityQueue<Node>(100, new Comparator<Node>() {
        @Override//from   w  w w  .  j  ava  2 s . co  m
        public int compare(Node o1, Node o2) {
            return o1.cost.compareTo(o2.cost);
        }
    });
    q.offer(newNode(start.toString(), 0d));
}

From source file:org.locationtech.geogig.storage.memory.ShortestPathWalker.java

ShortestPathWalker(Node start, Node end) {
    this.start = start;
    this.end = end;

    nodes = Maps.newHashMap();
    q = new PriorityQueue<CostNode>(100, new Comparator<CostNode>() {
        @Override/* w  w w  . ja va 2 s  .  co  m*/
        public int compare(CostNode o1, CostNode o2) {
            return o1.cost.compareTo(o2.cost);
        }
    });
    q.offer(newNode(start, 0d));
}