List of usage examples for java.util Collections unmodifiableList
public static <T> List<T> unmodifiableList(List<? extends T> list)
From source file:io.kazuki.v0.store.schema.model.Attribute.java
@JsonCreator public Attribute(@JsonProperty("name") String name, @JsonProperty("type") Type type, @JsonProperty("values") List<Object> values, @JsonProperty("nullable") Boolean nullable, @JsonProperty("renameOf") @Nullable String renameOf) { if (name == null) { throw new IllegalArgumentException("Attribute 'name' must not be null"); }//w ww . j a va 2 s . com if (type == null) { throw new IllegalArgumentException("Attribute 'type' must be specified"); } this.name = name; this.type = type; this.nullable = (nullable == null) || nullable; this.renameOf = renameOf; if (values != null) { List<String> newVals = new ArrayList<String>(); for (Object object : values) { newVals.add(String.valueOf(object)); } this.values = Collections.unmodifiableList(newVals); } else { this.values = null; } }
From source file:com.kixeye.chassis.transport.websocket.WebSocketAction.java
static public void addWebSocketResponseConverter(WebSocketResponseConverter converter) { synchronized (responseConverters) { List<WebSocketResponseConverter> newConverters = Lists.newArrayList(responseConverters.get()); newConverters.add(0, converter); responseConverters.set(Collections.unmodifiableList(newConverters)); }/*from www .j av a 2s . com*/ }
From source file:com.hortonworks.registries.schemaregistry.avro.LocalRegistryServerHATest.java
@Before public void startZooKeeper() throws Exception { testingServer = new TestingServer(true); URI configPath = Resources.getResource("schema-registry-test-ha.yaml").toURI(); String fileContent = IOUtils.toString(configPath, "UTF-8"); File registryConfigFile = File.createTempFile("ha-", ".yaml"); registryConfigFile.deleteOnExit();/*from www .ja va 2s .c o m*/ try (FileWriter writer = new FileWriter(registryConfigFile)) { IOUtils.write(fileContent.replace("__zk_connect_url__", testingServer.getConnectString()), writer); } List<LocalSchemaRegistryServer> schemaRegistryServers = new ArrayList<>(); for (int i = 1; i < 4; i++) { LocalSchemaRegistryServer server = new LocalSchemaRegistryServer(registryConfigFile.getAbsolutePath()); schemaRegistryServers.add(server); server.start(); } registryServers = Collections.unmodifiableList(schemaRegistryServers); }
From source file:eu.operando.operandoapp.wifi.model.WiFiData.java
@NonNull public List<WiFiDetail> getWiFiDetails(@NonNull WiFiBand wiFiBand, @NonNull SortBy sortBy, @NonNull GroupBy groupBy) {//from w w w . ja va 2 s. c o m List<WiFiDetail> results = getWiFiDetails(wiFiBand); if (!results.isEmpty() && !GroupBy.NONE.equals(groupBy)) { results = getWiFiDetails(results, sortBy, groupBy); } Collections.sort(results, sortBy.comparator()); return Collections.unmodifiableList(results); }
From source file:org.jasig.cas.validation.ImmutableAssertion.java
public List<Authentication> getChainedAuthentications() { return Collections.unmodifiableList(this.chainedAuthentications); }
From source file:org.jasig.schedassist.web.security.DelegateCalendarAccountUserDetailsImpl.java
public Collection<GrantedAuthority> getAuthorities() { List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>(); if (null != this.delegateCalendarAccount && this.delegateCalendarAccount.isEligible()) { authorities.add(SecurityConstants.DELEGATE_REGISTER); }//from w w w . j a va 2 s .c om if (null != this.scheduleOwner) { authorities.add(SecurityConstants.DELEGATE_OWNER); authorities.remove(SecurityConstants.DELEGATE_REGISTER); } return Collections.unmodifiableList(authorities); }
From source file:org.jasig.portlet.emailpreview.service.auth.pp.PortletPreferencesCredentialsAuthenticationService.java
public PortletPreferencesCredentialsAuthenticationService() { List<ConfigurationParameter> params = new ArrayList<ConfigurationParameter>(); ConfigurationParameter usernameParam = new ConfigurationParameter(); usernameParam.setKey(MailPreferences.MAIL_ACCOUNT.getKey()); usernameParam.setLabel("Mail account name"); usernameParam.setEncryptionRequired(true); params.add(usernameParam);/* www . ja v a2s . com*/ ConfigurationParameter passwordParam = new ConfigurationParameter(); passwordParam.setKey(MailPreferences.PASSWORD.getKey()); passwordParam.setLabel("Password"); passwordParam.setEncryptionRequired(true); params.add(passwordParam); setUserParameters(Collections.unmodifiableList(params)); setAdminParameters(Collections.<ConfigurationParameter>singletonList( PortletPreferencesCredentialsAuthenticationService.ACCOUNT_NAME_ATTRIBUTE)); Map<String, ConfigurationParameter> m = new HashMap<String, ConfigurationParameter>(); for (ConfigurationParameter param : userParameters) { m.put(param.getKey(), param); } setConfigParams(Collections.unmodifiableMap(m)); }
From source file:com.phoenixst.plexus.algorithms.DepthFirstForestView.java
/** * Creates a new <code>DepthFirstForestView</code>. *//*from www .j a v a2 s . c om*/ public DepthFirstForestView(Graph graph, Transformer traverserFactory) { super(graph, traverserFactory, LOGGER); // Iterate over nodes, selecting roots from new ones. List rootList = new ArrayList(); int time = 0; for (Iterator i = graph.nodes(null).iterator(); i.hasNext();) { Object node = i.next(); if (!hasProcessedNode(node)) { rootList.add(node); time = visitTree(node, time); } } // Create the list of roots which the user sees. roots = Collections.unmodifiableList(rootList); }
From source file:com.flexive.shared.TimestampRecorder.java
/** * Returns the list of timestamps in nanosecond precision. * * @return the list of timestamps in nanosecond precision. */// www . jav a2 s . co m public List<Pair<String, Long>> getTimestamps() { return Collections.unmodifiableList(timestamps); }
From source file:de.xirp.profile.CommunicationInterface.java
/** * Returns an list of//from w w w . j a v a 2s .co m * {@link de.xirp.profile.Option options} for this * communication interface. * * @return An unmodifiable list containing the options. */ @XmlTransient public List<Option> getOptions() { return Collections.unmodifiableList(options); }