List of usage examples for com.google.common.collect ImmutableSet.Builder ImmutableSet.Builder
ImmutableSet.Builder
From source file:co.freeside.betamax.Configuration.java
/** * Hosts that are ignored by Betamax. Any connections made will be allowed to proceed normally and not be * intercepted./*from ww w .jav a 2 s. c o m*/ */ public Collection<String> getIgnoreHosts() { if (isIgnoreLocalhost()) { return new ImmutableSet.Builder<String>().addAll(ignoreHosts).addAll(Network.getLocalAddresses()) .build(); } else { return ignoreHosts; } }
From source file:de.uniluebeck.itm.jaxb4osm.elements.OsmElement.java
/** * Returns an {@link com.google.common.collect.ImmutableSet} containing the IDs of the * {@link de.uniluebeck.itm.jaxb4osm.elements.WayElement}s that were already added and refer to the given * nodeID./*from www . j a va2 s. com*/ * * <b>Note:</b> The reason for making the result immutable is to keep the references returned by * {@link #getReferencingWayIDs(long)} properly * * @return an {@link com.google.common.collect.ImmutableSet} containing the IDs of the * {@link de.uniluebeck.itm.jaxb4osm.elements.WayElement}s that were already added and refer to the given * nodeID. */ public ImmutableSet<Long> getReferencingWayIDs(long nodeID) { if (!this.nodeReferences.containsKey(nodeID)) return new ImmutableSet.Builder<Long>().build(); return new ImmutableSet.Builder<Long>().addAll(this.nodeReferences.get(nodeID)).build(); }