List of usage examples for java.util Collections unmodifiableMap
public static <K, V> Map<K, V> unmodifiableMap(Map<? extends K, ? extends V> m)
From source file:it.inserpio.neo4art.spatial.SpatialQueriesTest.java
@Test public void addMuseumToSpatialIndex() { GraphDatabaseService graphDatabaseService = this.neo4jTemplate.getGraphDatabaseService(); IndexManager indexManager = graphDatabaseService.index(); Map<String, String> config = Collections.unmodifiableMap(MapUtil.stringMap( SpatialIndexProvider.GEOMETRY_TYPE, LayerNodeIndex.POINT_GEOMETRY_TYPE, IndexManager.PROVIDER, SpatialIndexProvider.SERVICE_NAME, LayerNodeIndex.WKT_PROPERTY_KEY, "wkt")); Index<Node> index = indexManager.forNodes(MuseumRepository.MUSEUM_GEOSPATIAL_INDEX, config); Iterator<Node> museums = this.neo4jTemplate.query("MATCH (m:MUSEUM) RETURN m", null).to(Node.class) .iterator();/*from w ww . j a v a 2 s. c om*/ while (museums.hasNext()) { Node museum = museums.next(); if (museum.hasProperty("wkt")) { System.out.println("Adding " + museum.getProperty("name") + " to " + MuseumRepository.MUSEUM_GEOSPATIAL_INDEX + " index..."); index.add(museum, "dummy", "value"); } else { System.out.println(museum.getProperty("name") + " NOT ADDED to " + MuseumRepository.MUSEUM_GEOSPATIAL_INDEX + " index..."); } } }
From source file:contrail.stages.CompressAndCorrect.java
/** * Get the parameters used by this stage. *//*from w ww . j ava 2 s. co m*/ protected Map<String, ParameterDefinition> createParameterDefinitions() { HashMap<String, ParameterDefinition> definitions = new HashMap<String, ParameterDefinition>(); // We add all the options for the stages we depend on. Stage[] substages = { new CompressChains(), new RemoveTipsAvro(), new FindBubblesAvro(), new PopBubblesAvro(), new RemoveLowCoverageAvro() }; for (Stage stage : substages) { definitions.putAll(stage.getParameterDefinitions()); } return Collections.unmodifiableMap(definitions); }
From source file:fr.paris.lutece.portal.web.upload.MultipartHttpServletRequest.java
/** * Constructor/* www . j a v a 2s.com*/ * @param request The HTTP request * @param multipartFiles Files * @param parameters Request parameters */ public MultipartHttpServletRequest(HttpServletRequest request, Map<String, FileItem> multipartFiles, Map<String, String[]> parameters) { super(request); _multipartFiles = Collections.unmodifiableMap(multipartFiles); _stringParameters = Collections.unmodifiableMap(parameters); }
From source file:com.thoughtworks.go.config.materials.AbstractMaterial.java
public final Map<String, Object> getSqlCriteria() { if (sqlCriteria == null) { Map<String, Object> map = new LinkedHashMap<>(); map.put("type", type); appendCriteria(map);//www . j a v a 2s.c o m sqlCriteria = Collections.unmodifiableMap(map); } return sqlCriteria; }
From source file:com.opengamma.analytics.financial.provider.curve.CurveBuildingBlockBundle.java
/** * Gets all of the underlying data./*from w ww.j a va2 s .c om*/ * @return The data wrapped in an unmodifiable map */ public Map<String, Pair<CurveBuildingBlock, DoubleMatrix2D>> getData() { return Collections.unmodifiableMap(_bundle); }
From source file:face4j.Parameters.java
public Map<String, String> getMap() { return Collections.unmodifiableMap(params); }
From source file:fi.hsl.parkandride.core.service.PredictionService.java
public PredictionService(UtilizationRepository utilizationRepository, PredictionRepository predictionRepository, PredictorRepository predictorRepository, FacilityRepository facilityRepository, PlatformTransactionManager transactionManager, LockRepository lockRepository, Predictor... predictors) { this.utilizationRepository = utilizationRepository; this.predictionRepository = predictionRepository; this.predictorRepository = predictorRepository; this.transactionManager = transactionManager; this.facilityRepository = facilityRepository; this.lockRepository = lockRepository; Map<String, Predictor> predictorsByType = new HashMap<>(); for (Predictor predictor : predictors) { predictorsByType.put(predictor.getType(), predictor); }// www.j ava 2 s . c o m this.predictorsByType = Collections.unmodifiableMap(predictorsByType); }
From source file:com.anrisoftware.sscontrol.debug.internal.DebugLoggingImpl.java
@Override public Map<String, DebugModule> getModules() { return Collections.unmodifiableMap(modules); }
From source file:de.skuzzle.polly.http.internal.HttpEventImpl.java
public HttpEventImpl(HttpServer source, RequestMode mode, URI requestURI, InetSocketAddress remoteAddress, String plainUri, HttpSession session, Map<String, String> cookies, Map<String, String> get, Map<String, String> post, String requestBody) { this.source = source; this.mode = mode; this.requestUri = requestURI; this.plainUri = plainUri; this.clientIp = remoteAddress; this.session = session; this.requestBody = requestBody; this.cookies = Collections.unmodifiableMap(cookies); this.get = Collections.unmodifiableMap(get); this.post = Collections.unmodifiableMap(post); this.closeListener = new ArrayList<>(); this.creationTime = new Date(); }
From source file:com.liferay.mobile.android.service.SessionImpl.java
@Override public Map<String, String> getHeaders() { return Collections.unmodifiableMap(headers); }