List of usage examples for java.util Collections unmodifiableSet
public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
From source file:eu.europa.esig.dss.pdf.PdfDssDict.java
public Set<BasicOCSPResp> getOcspList() { return Collections.unmodifiableSet(ocspList); }
From source file:org.openwms.wms.shipping.ShippingOrderPosition.java
/** * Get the orderPositionSplits.//ww w . java2 s . c o m * * @return the orderPositionSplits. */ public Set<ShippingOrderPositionSplit> getShippingOrderPositionSplits() { return Collections.unmodifiableSet(orderPositionSplits); }
From source file:edu.ur.ir.file.VersionedFile.java
/** * The versions of this ir file. This returns an unmodifiable set. * //from www. ja v a2 s . c o m * @return the versions */ public Set<FileVersion> getVersions() { return Collections.unmodifiableSet(versions); }
From source file:com.oltpbenchmark.util.ClassUtil.java
/** * Get a set of all of the interfaces that the element_class implements * @param element_class//from w w w. j a v a 2 s.com * @return */ @SuppressWarnings("unchecked") public static Collection<Class<?>> getInterfaces(Class<?> element_class) { Set<Class<?>> ret = ClassUtil.CACHE_getInterfaceClasses.get(element_class); if (ret == null) { // ret = new HashSet<Class<?>>(); // Queue<Class<?>> queue = new LinkedList<Class<?>>(); // queue.add(element_class); // while (!queue.isEmpty()) { // Class<?> current = queue.poll(); // for (Class<?> i : current.getInterfaces()) { // ret.add(i); // queue.add(i); // } // FOR // } // WHILE ret = new HashSet<Class<?>>(ClassUtils.getAllInterfaces(element_class)); if (element_class.isInterface()) ret.add(element_class); ret = Collections.unmodifiableSet(ret); ClassUtil.CACHE_getInterfaceClasses.put(element_class, ret); } return (ret); }
From source file:com.ikanow.aleph2.management_db.mongodb.services.TestIkanowV1SyncService_TestBuckets.java
@SuppressWarnings("deprecation") @Test// w ww .ja v a2 s .c om public void test_sourceToBucketConversion() throws JsonProcessingException, IOException, ParseException { _logger.info("Starting test_SourceToBucketConversion"); final ObjectMapper mapper = BeanTemplateUtils.configureMapper(Optional.empty()); final JsonNode v1_source = mapper .readTree(this.getClass().getResourceAsStream("test_v1_sync_sample_source.json")); final DataBucketBean bucket = IkanowV1SyncService_TestBuckets.getBucketFromV1Source(v1_source); assertEquals("506dc16dfbf042893dd6b8f2aleph...bucket.Template_V2_data_bucket.;", bucket._id()); assertEquals(Collections.unmodifiableSet(new HashSet<String>()), bucket.aliases()); assertEquals(1, bucket.batch_enrichment_configs().size()); assertEquals(false, bucket.batch_enrichment_configs().get(0).enabled()); assertEquals(1, bucket.batch_enrichment_configs().get(0).config().get("key1")); assertEquals("value2", bucket.batch_enrichment_configs().get(0).config().get("key2")); assertEquals(null, bucket.batch_enrichment_topology()); assertEquals("21 May 2015 02:37:23 GMT", bucket.created().toGMTString()); assertEquals(null, bucket.data_locations()); assertEquals(true, bucket.data_schema().columnar_schema().enabled()); assertEquals(null, bucket.data_schema().data_warehouse_schema()); assertEquals(false, bucket.data_schema().document_schema().enabled()); assertEquals(null, bucket.data_schema().geospatial_schema()); assertEquals(null, bucket.data_schema().graph_schema()); assertEquals(true, bucket.data_schema().search_index_schema().enabled()); assertEquals("week", bucket.data_schema().storage_schema().raw().grouping_time_period()); assertEquals(true, bucket.data_schema().temporal_schema().enabled()); assertEquals("DESCRIPTION HERE.", bucket.description()); assertEquals("Template V2 data bucket", bucket.display_name()); assertEquals("/bucket/path/here", bucket.full_name()); assertEquals(1, bucket.harvest_configs().size()); assertEquals(true, bucket.harvest_configs().get(0).enabled()); assertEquals("value1_harvest", bucket.harvest_configs().get(0).config().get("key1")); assertEquals("/app/aleph2/library/import/harvest/tech/XXX", bucket.harvest_technology_name_or_id()); assertEquals("streaming", bucket.master_enrichment_type().toString()); assertEquals("25 May 2015 13:52:01 GMT", bucket.modified().toGMTString()); assertEquals(null, bucket.multi_bucket_children()); assertEquals(false, bucket.multi_node_enabled()); assertEquals(Arrays.asList(), bucket.node_list_rules()); assertEquals("506dc16dfbf042893dd6b8f2", bucket.owner_id()); assertEquals(null, bucket.poll_frequency()); assertEquals(null, bucket.streaming_enrichment_configs()); assertEquals(true, bucket.streaming_enrichment_topology().enabled()); assertEquals("value1_streaming", bucket.streaming_enrichment_topology().config().get("key1")); assertEquals(Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("test"))), bucket.tags()); }
From source file:ReferenceValueMap.java
/** * Accessor for the entry set./*w ww.java 2s .com*/ * @return The Set. **/ public Set entrySet() { reap(); Set s = map.entrySet(); Iterator i = s.iterator(); HashMap m = new HashMap(s.size()); while (i.hasNext()) { Map.Entry entry = (Map.Entry) i.next(); Reference ref = (Reference) entry.getValue(); Object obj = ref.get(); if (obj != null) { m.put(entry.getKey(), obj); } } return Collections.unmodifiableSet(m.entrySet()); }
From source file:eu.europa.esig.dss.pdf.PdfDssDict.java
public Set<CertificateToken> getCertList() { return Collections.unmodifiableSet(certList); }
From source file:libepg.epg.section.descriptor.servicedescriptor.SERVICE_ID.java
private SERVICE_ID(String serviceType, Integer serviceId, Integer... serviceIds) { this.serviceType = serviceType; if ((this.serviceType == null) || (this.serviceType.equals(""))) { throw new IllegalArgumentException("??????"); }/*from w w w .j a va 2s . co m*/ List<Integer> t = new ArrayList<>(); if (serviceId != null) { t.add(serviceId); } else { throw new NullPointerException("ID??????"); } if (serviceIds != null) { t.addAll(Arrays.asList(serviceIds)); } Range<Integer> r = Range.between(0x0, 0xFF); for (Integer i : t) { if (!r.contains(i)) { MessageFormat msg = new MessageFormat( "ID????ID={0}"); Object[] parameters = { Integer.toHexString(i) }; throw new IllegalArgumentException(msg.format(parameters)); } } Set<Integer> temp = Collections.synchronizedSet(new HashSet<Integer>()); temp.addAll(t); this.serviceIds = Collections.unmodifiableSet(temp); }
From source file:de.itsvs.cwtrpc.controller.RemoteServiceControllerServlet.java
@SuppressWarnings("unchecked") protected Set<Class<? extends RuntimeException>> getUncaughtExceptions( RemoteServiceControllerConfig controllerConfig) { final Set<Class<? extends RuntimeException>> exceptions; final Class<? extends RuntimeException> exception; exceptions = new HashSet<Class<? extends RuntimeException>>(); try {/*from www . j a v a2 s .c om*/ exception = (Class<? extends RuntimeException>) Class.forName(ACCESS_DENIED_EXCEPTION_NAME); exceptions.add(exception); } catch (ClassNotFoundException e) { if (log.isDebugEnabled()) { log.debug("Did not find class " + ACCESS_DENIED_EXCEPTION_NAME + ". Exception will not be used " + "as uncaught exception.", e); } } return Collections.unmodifiableSet(exceptions); }
From source file:com.bstek.dorado.data.variant.MetaData.java
protected Set<Entry<String, Object>> doGetEntrySet() { Set<Entry<String, Object>> entrySet = new HashSet<Entry<String, Object>>(); for (String property : keySet()) { MapEntry entry = new MapEntry(this, property); entrySet.add(entry);/*from www . j a v a2 s .c o m*/ } return Collections.unmodifiableSet(entrySet); }