Tabnine Logo
CollectionsExt.toArray
Code IndexAdd Tabnine to your IDE (free)

How to use
toArray
method
in
org.apache.sis.internal.util.CollectionsExt

Best Java code snippets using org.apache.sis.internal.util.CollectionsExt.toArray (Showing top 5 results out of 315)

origin: org.apache.sis.core/sis-utility

case 0:  return Collections.emptyList();
case 1:  return Collections.singletonList(merged.get(0));
default: return Containers.unmodifiableList(CollectionsExt.toArray(merged, Identifier.class));
origin: apache/sis

case 0:  return Collections.emptyList();
case 1:  return Collections.singletonList(merged.get(0));
default: return Containers.unmodifiableList(CollectionsExt.toArray(merged, Identifier.class));
origin: apache/sis

  /**
   * Tests {@link CollectionsExt#toArray(Collection, Class)}.
   *
   * @since 0.6
   */
  @Test
  public void testToArray() {
    final String[] expected = new String[] {"One", "Two", "Three"};
    final String[] actual = CollectionsExt.toArray(Arrays.asList(expected), String.class);
    assertArrayEquals(expected, actual);
  }
}
origin: apache/sis

/**
 * Creates a new descriptor with the same properties than the {@code provided} one, but completed with
 * information not found in GML. Those extra information are given by the {@code complete} descriptor.
 *
 * <p>It is the caller's responsibility to construct the {@code merged} properties as a merge of the properties
 * of the two given descriptors. This can be done with the help of {@link #mergeArrays(String, Class, Collection,
 * Map, Identifier)} among others.</p>
 */
private static <T> ParameterDescriptor<T> create(final Map<String,?>          merged,
                         final ParameterDescriptor<?> provided,
                         final ParameterDescriptor<T> complete)
{
  final Class<T> valueClass = complete.getValueClass();
  return new DefaultParameterDescriptor<>(merged,
      provided.getMinimumOccurs(),
      provided.getMaximumOccurs(),
      // Values below this point are not provided in GML documents,
      // so they must be inferred from the pre-defined descriptor.
      valueClass,
      Parameters.getValueDomain(complete),
      CollectionsExt.toArray(complete.getValidValues(), valueClass),
      complete.getDefaultValue());
}
origin: org.apache.sis.core/sis-referencing

/**
 * Creates a new descriptor with the same properties than the {@code provided} one, but completed with
 * information not found in GML. Those extra information are given by the {@code complete} descriptor.
 *
 * <p>It is the caller's responsibility to construct the {@code merged} properties as a merge of the properties
 * of the two given descriptors. This can be done with the help of {@link #mergeArrays(String, Class, Collection,
 * Map, Identifier)} among others.</p>
 */
private static <T> ParameterDescriptor<T> create(final Map<String,?>          merged,
                         final ParameterDescriptor<?> provided,
                         final ParameterDescriptor<T> complete)
{
  final Class<T> valueClass = complete.getValueClass();
  return new DefaultParameterDescriptor<>(merged,
      provided.getMinimumOccurs(),
      provided.getMaximumOccurs(),
      // Values below this point are not provided in GML documents,
      // so they must be inferred from the pre-defined descriptor.
      valueClass,
      Parameters.getValueDomain(complete),
      CollectionsExt.toArray(complete.getValidValues(), valueClass),
      complete.getDefaultValue());
}
org.apache.sis.internal.utilCollectionsExttoArray

Javadoc

Returns the elements of the given collection as an array. This method can be used when the valueClassargument is not known at compile-time. If the valueClass is known at compile-time, then callers should use Collection#toArray(Object[]) instead.

Popular methods of CollectionsExt

  • singletonOrEmpty
    Returns the given value as a singleton if non-null, or returns an empty set otherwise.
  • unmodifiableOrCopy
    Returns a unmodifiable version of the given set. This method is different than the standard Collecti
  • addToMultiValuesMap
    Adds a value in a pseudo multi-values map. The multi-values map is simulated by a map of lists. The
  • compact
    Returns a more compact representation of the given set. This method is similar to #unmodifiableOrCop
  • first
    Returns the first element of the given iterable, or null if none. This method does not emit warning
  • immutableSet
    Returns the specified array as an immutable set, or null if the array is null. If the given array co
  • nonNull
    Returns the given set, or Collections#EMPTY_SET if the given set is null.
  • createSetForType
    Creates an initially empty set for elements of the given type. This method will creates specialized
  • emptySortedSet
    Returns a SortedSet which is always empty and accepts no element.Note: This method exists only on th
  • filter
    Returns an iterator over the elements of the given iterator where the predicate returns true. The it
  • identityEquals
    Returns true if the next elements returned by the given iterators are the same. This method compares
  • modifiableCopy
    Copies the content of the given map to a new unsynchronized, modifiable, in-memory map. The implemen
  • identityEquals,
  • modifiableCopy,
  • nonNullArraySet,
  • removeFromMultiValuesMap,
  • toCaseInsensitiveNameMap,
  • toCollection,
  • empty,
  • emptyQueue,
  • nonEmpty

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getResourceAsStream (ClassLoader)
  • requestLocationUpdates (LocationManager)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now