/** * Returns the names of feature properties that this operation needs for performing its task. */ @Override @SuppressWarnings("ReturnOfCollectionOrArrayField") public synchronized Set<String> getDependencies() { if (dependencies == null) { dependencies = CollectionsExt.immutableSet(true, attributeNames); } return dependencies; }
/** * Returns the names of feature properties that this operation needs for performing its task. */ @Override @SuppressWarnings("ReturnOfCollectionOrArrayField") public synchronized Set<String> getDependencies() { if (dependencies == null) { dependencies = CollectionsExt.immutableSet(true, attributeNames); } return dependencies; }
/** * Returns the names of feature properties that this operation needs for performing its task. */ @Override @SuppressWarnings("ReturnOfCollectionOrArrayField") public synchronized Set<String> getDependencies() { if (dependencies == null) { dependencies = CollectionsExt.immutableSet(true, attributeNames); } return dependencies; }
/** * Returns the names of feature properties that this operation needs for performing its task. */ @Override @SuppressWarnings("ReturnOfCollectionOrArrayField") public synchronized Set<String> getDependencies() { if (dependencies == null) { dependencies = CollectionsExt.immutableSet(true, attributeNames); } return dependencies; }
/** * Filters names, aliases and identifiers by their code spaces. If the given array is non-null, then the only names, * aliases and identifiers to be formatted are those having a {@link ReferenceIdentifier#getCodeSpace()}, * {@link ScopedName#head()} or {@link GenericName#scope()} value in the given list, unless no name or alias * matches this criterion. * * @param codespaces the preferred code spaces of names, aliases and identifiers to format, or {@code null} * for accepting all of them. Some typical values are {@code "EPSG"}, {@code "OGC"} or {@code "GeoTIFF"}. */ public void setPreferredCodespaces(final String... codespaces) { Set<String> copy = null; if (codespaces != null) { copy = CollectionsExt.immutableSet(true, codespaces); } this.preferredCodespaces = copy; }
/** * Filters names, aliases and identifiers by their code spaces. If the given array is non-null, then the only names, * aliases and identifiers to be formatted are those having a {@link ReferenceIdentifier#getCodeSpace()}, * {@link ScopedName#head()} or {@link GenericName#scope()} value in the given list, unless no name or alias * matches this criterion. * * @param codespaces the preferred code spaces of names, aliases and identifiers to format, or {@code null} * for accepting all of them. Some typical values are {@code "EPSG"}, {@code "OGC"} or {@code "GeoTIFF"}. */ public void setPreferredCodespaces(final String... codespaces) { Set<String> copy = null; if (codespaces != null) { copy = CollectionsExt.immutableSet(true, codespaces); } this.preferredCodespaces = copy; }
/** * Returns a copy of the given array as a non-empty immutable set. * If the given array is empty, then this method returns {@code null}. * * @param <T> the type of elements. * @param elements the elements to copy in a set. * @return an unmodifiable set which contains all the given elements, or {@code null}. * * @since 0.6 */ @SafeVarargs public static <T> Set<T> nonEmptySet(final T... elements) { final Set<T> asSet = immutableSet(true, elements); return (asSet != null && asSet.isEmpty()) ? null : asSet; }
/** * Returns the specified array as an immutable set, or {@code null} if the array is null. * If the given array contains duplicated elements, i.e. elements that are equal in the * sense of {@link Object#equals(Object)}, then only the last instance of the duplicated * values will be included in the returned set. * * @param <E> The type of array elements. * @param array The array to copy in a set. May be {@code null}. * @return A set containing the array elements, or {@code null} if the given array was null. * * @see Collections#unmodifiableSet(Set) * * @since 3.17 */ @SafeVarargs public static <E> Set<E> immutableSet(final E... array) { return CollectionsExt.immutableSet(false, array); }
/** * Returns a copy of the given array as a non-empty immutable set. * If the given array is empty, then this method returns {@code null}. * * @param <T> the type of elements. * @param elements the elements to copy in a set. * @return an unmodifiable set which contains all the given elements, or {@code null}. * * @since 0.6 */ @SafeVarargs public static <T> Set<T> nonEmptySet(final T... elements) { final Set<T> asSet = immutableSet(true, elements); return (asSet != null && asSet.isEmpty()) ? null : asSet; }
/** * Sets an enumeration of valid values for the attribute. * * <p>This is a convenience method for {@link #addCharacteristic(Class)} with a value * of type {@link Set} and a conventional name.</p> * * @param values valid values. * @return {@code this} for allowing method calls chaining. * * @see #characteristics() * @see AttributeConvention#VALID_VALUES_CHARACTERISTIC */ @SafeVarargs public final AttributeTypeBuilder<V> setValidValues(final V... values) { return setCharacteristic(AttributeConvention.VALID_VALUES_CHARACTERISTIC, Set.class, CollectionsExt.immutableSet(false, values)); }
/** * Sets an enumeration of valid values for the attribute. * * <p>This is a convenience method for {@link #addCharacteristic(Class)} with a value * of type {@link Set} and a conventional name.</p> * * @param values valid values. * @return {@code this} for allowing method calls chaining. * * @see #characteristics() * @see AttributeConvention#VALID_VALUES_CHARACTERISTIC */ @SafeVarargs public final AttributeTypeBuilder<V> setValidValues(final V... values) { return setCharacteristic(AttributeConvention.VALID_VALUES_CHARACTERISTIC, Set.class, CollectionsExt.immutableSet(false, values)); }
this.superTypes = Collections.emptySet(); } else { this.superTypes = CollectionsExt.immutableSet(true, superTypes); for (final FeatureType type : this.superTypes) { if (type instanceof NamedFeatureType) {
} else { clones(array); collection = CollectionsExt.immutableSet(false, array);
} else { applyToAll(array); collection = CollectionsExt.immutableSet(false, array);
this.superTypes = Collections.emptySet(); } else { this.superTypes = CollectionsExt.immutableSet(true, superTypes); for (final FeatureType type : this.superTypes) { if (type instanceof NamedFeatureType) {
throw (IllegalArgumentException) illegalPropertyType(properties, ALIAS_KEY, value).initCause(e); alias = immutableSet(true, names); identifiers = Collections.singleton((ReferenceIdentifier) value); } else if (value instanceof ReferenceIdentifier[]) { identifiers = immutableSet(true, (ReferenceIdentifier[]) value); } else { throw illegalPropertyType(properties, IDENTIFIERS_KEY, value);
throw (IllegalArgumentException) illegalPropertyType(properties, ALIAS_KEY, value).initCause(e); alias = immutableSet(true, names); identifiers = Collections.singleton((ReferenceIdentifier) value); } else if (value instanceof ReferenceIdentifier[]) { identifiers = immutableSet(true, (ReferenceIdentifier[]) value); } else { throw illegalPropertyType(properties, IDENTIFIERS_KEY, value);