@Override public Set<String> keys() { return Collect.unmodifiableSet(newToOld.keySet()); }
@SuppressWarnings("unchecked") public static <T> Set<T> unmodifiableSet(T... values) { return unmodifiableSet(arrayListOf(values)); }
@Override public Set<String> keys() { return Collect.unmodifiableSet(Configuration.this.keys().stream() .filter(k -> k != null) .filter(matcher) .collect(Collectors.toSet())); }
/** * Get the set of {@link TableId}s for which there is a {@link Schema}. * * @return the immutable set of table identifiers; never null */ public Set<TableId> tableIds() { return lock.read(() -> Collect.unmodifiableSet(tablesByTableId.ids())); }
private SqlTypeMapper(Connection db, TypeInfo typeInfo) throws SQLException { this.typeInfo = typeInfo; this.preloadedSqlTypes = Collect.unmodifiableSet(typeInfo.getPGTypeNamesWithSQLTypes()); this.sqlTypesByPgTypeNames = getSqlTypes(db, typeInfo); }
@Test(expected=UnsupportedOperationException.class) public void unmodifiableSetForIteratorShouldRaiseExceptionUponModification() { Set<Integer> values = Collect.unmodifiableSet(Arrays.asList(1, 2, 3, 42).iterator()); values.remove(1); } }
@Test public void unmodifiableSetForIteratorShouldReturnExpectedElements() { Set<Integer> values = Collect.unmodifiableSet(Arrays.asList(1, 2, 3, 42).iterator()); assertThat(values).containsOnly(1, 2, 3, 42); }
@Override public Set<String> keys() { return Collect.unmodifiableSet(newToOld.keySet()); }
@SuppressWarnings("unchecked") public static <T> Set<T> unmodifiableSet(T... values) { return unmodifiableSet(arrayListOf(values)); }
@Override public Set<String> keys() { return Collect.unmodifiableSet(Configuration.this.keys().stream() .filter(k -> k != null) .filter(matcher) .collect(Collectors.toSet())); }
/** * Get the set of {@link TableId}s for which there is a {@link Schema}. * * @return the immutable set of table identifiers; never null */ public Set<TableId> tableIds() { return lock.read(() -> Collect.unmodifiableSet(tablesByTableId.ids())); }
private SqlTypeMapper(Connection db, TypeInfo typeInfo) throws SQLException { this.typeInfo = typeInfo; this.preloadedSqlTypes = Collect.unmodifiableSet(typeInfo.getPGTypeNamesWithSQLTypes()); this.sqlTypesByPgTypeNames = getSqlTypes(db, typeInfo); }