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:org.openmrs.module.metadatasharing.handler.impl.ConceptHandler.java
public ConceptHandler() { Map<Class<? extends Concept>, String> tmpTypes = new HashMap<Class<? extends Concept>, String>(); tmpTypes.put(Concept.class, "Concept"); types = Collections.unmodifiableMap(tmpTypes); }
From source file:springfox.documentation.spring.web.DocumentationCache.java
public Map<String, Documentation> all() { return Collections.unmodifiableMap(documentationLookup); }
From source file:org.sunnycode.schema.Schema.java
@JsonCreator public Schema(@JsonProperty("attributes") List<Attribute> attributes) { if (attributes == null) { throw new IllegalArgumentException("'attributes' must be present"); }//from w ww. j a v a2 s.co m this.attributes = Collections.unmodifiableList(attributes); Map<String, Attribute> newAttributes = new LinkedHashMap<String, Attribute>(); for (Attribute attr : attributes) { newAttributes.put(attr.getName(), attr); } this.attributeMap = Collections.unmodifiableMap(newAttributes); }
From source file:epgtools.epgdbbean.bean.channel.ChannelGetter.java
/** * DB?????????/*w ww.jav a 2 s. co m*/ * * @return ??????(??) ????? * @throws java.sql.SQLException */ public synchronized Map<Integer, Useablechannels_ReadOnly> getChannels() throws SQLException { //? Map<Integer, Useablechannels> Channels; Channels = Collections.synchronizedMap(runner.query(con, ChannelGetter.GET_CHANNELS, new BeanMapHandler<Integer, Useablechannels>(Useablechannels.class, "channel_no"))); Map<Integer, Useablechannels_ReadOnly> Channels_Ro; Channels_Ro = Collections.synchronizedMap(new TreeMap<Integer, Useablechannels_ReadOnly>()); Channels_Ro.putAll(Channels); return Collections.unmodifiableMap(Channels_Ro); }
From source file:cf.nats.message.RouterRegister.java
@JsonCreator public RouterRegister(@JsonProperty("host") String host, @JsonProperty("port") Integer port, @JsonProperty("app") String app, @JsonProperty("dea") String dea, @JsonProperty("uris") List<String> uris, @JsonProperty("tags") Map<String, String> tags) { this.host = host; this.port = port; this.app = app; this.dea = dea; this.uris = Collections.unmodifiableList(new ArrayList<>(uris)); this.tags = tags == null ? null : Collections.unmodifiableMap(new HashMap<>(tags)); }
From source file:com.persistent.cloudninja.utils.RoleBasedAccessControlInterceptor.java
public Map<String, String> getAdminurls() { return Collections.unmodifiableMap(adminurls); }
From source file:com.sinosoft.one.mvc.web.var.ModelImpl.java
public Map<String, Object> getAttributes() { final Map<String, Object> cloneAndFiltered = new HashMap<String, Object>(map.size() * 2); synchronized (mutex) { final Iterator<Map.Entry<String, Object>> iterator = map.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<String, Object> entry = iterator.next(); final String key = entry.getKey(); if (key != null && !key.startsWith("$$one-mvc")) { cloneAndFiltered.put(key, entry.getValue()); }//from www . j a va2 s . c om } } return Collections.unmodifiableMap(cloneAndFiltered); }
From source file:org.openmrs.module.appframework.feature.FeatureToggleProperties.java
public Map<Object, Object> getToggleMap() { Properties toggles = loadToggles(); return Collections.unmodifiableMap(toggles); }
From source file:org.jam.metrics.applicationmetrics.utils.DataPoint.java
public DataPoint(Long timestamp, T value, Map<String, String> tags) { checkArgument(timestamp != null, "Data point timestamp is null"); checkArgument(value != null, "Data point value is null"); this.timestamp = timestamp; this.value = value; this.tags = Collections.unmodifiableMap(tags); }
From source file:org.jasig.portlet.emailpreview.service.auth.CachedPasswordAuthenticationService.java
public CachedPasswordAuthenticationService() { Map<String, ConfigurationParameter> m = new HashMap<String, ConfigurationParameter>(); for (ConfigurationParameter param : getAdminConfigurationParameters()) { m.put(param.getKey(), param);/*w ww . j a va2s . c om*/ } for (ConfigurationParameter param : getUserConfigurationParameters()) { m.put(param.getKey(), param); } setConfigParams(Collections.unmodifiableMap(m)); }