Tabnine Logo
Collections.emptyNavigableMap
Code IndexAdd Tabnine to your IDE (free)

How to use
emptyNavigableMap
method
in
java.util.Collections

Best Java code snippets using java.util.Collections.emptyNavigableMap (Showing top 20 results out of 315)

origin: google/guava

 @Override
 protected NavigableMap<String, String> create(Entry<String, String>[] entries) {
  return Collections.emptyNavigableMap();
 }
})
origin: wildfly/wildfly

classes.add(Collections.checkedList(nonRandomAccessList, Void.class).getClass());
classes.add(Collections.checkedMap(Collections.emptyMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedNavigableMap(Collections.emptyNavigableMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedNavigableSet(Collections.emptyNavigableSet(), Void.class).getClass());
classes.add(Collections.checkedQueue(new LinkedList<>(), Void.class).getClass());
classes.add(Collections.synchronizedList(nonRandomAccessList).getClass());
classes.add(Collections.synchronizedMap(Collections.emptyMap()).getClass());
classes.add(Collections.synchronizedNavigableMap(Collections.emptyNavigableMap()).getClass());
classes.add(Collections.synchronizedNavigableSet(Collections.emptyNavigableSet()).getClass());
classes.add(Collections.synchronizedSet(Collections.emptySet()).getClass());
classes.add(Collections.unmodifiableList(nonRandomAccessList).getClass());
classes.add(Collections.unmodifiableMap(Collections.emptyMap()).getClass());
classes.add(Collections.unmodifiableNavigableMap(Collections.emptyNavigableMap()).getClass());
classes.add(Collections.unmodifiableNavigableSet(Collections.emptyNavigableSet()).getClass());
classes.add(Collections.unmodifiableSet(Collections.emptySet()).getClass());
origin: wildfly/wildfly

assertTrue(immutability.test(Collections.emptyListIterator()));
assertTrue(immutability.test(Collections.emptyMap()));
assertTrue(immutability.test(Collections.emptyNavigableMap()));
assertTrue(immutability.test(Collections.emptyNavigableSet()));
assertTrue(immutability.test(Collections.emptySet()));
origin: com.google.guava/guava-testlib

 @Override
 protected NavigableMap<String, String> create(Entry<String, String>[] entries) {
  return Collections.emptyNavigableMap();
 }
})
origin: org.apache.sshd/sshd-osgi

  /**
   * @param <I> The {@link KeyTypeIndicator}
   * @param indicators The indicators to group
   * @return A {@link NavigableMap} where key=the case <U>insensitive</U> {@link #getKeyType() key type},
   * value = the {@link List} of all indicators having the same key type
   */
  static <I extends KeyTypeIndicator> NavigableMap<String, List<I>> groupByKeyType(Collection<? extends I> indicators) {
    return GenericUtils.isEmpty(indicators)
       ? Collections.emptyNavigableMap()
       : indicators.stream()
         .collect(Collectors.groupingBy(
           KeyTypeIndicator::getKeyType, () -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER), Collectors.toList()));
  }
}
origin: MartinHaeusler/chronos

protected static NavigableMap<String, byte[]> getMapReadOnly(final MapDBTransaction tx, final String mapName) {
  checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!");
  checkNotNull(mapName, "Precondition violation - argument 'mapName' must not be NULL!");
  if (tx.exists(mapName) == false) {
    return Collections.emptyNavigableMap();
  } else {
    return tx.treeMap(mapName, Serializer.STRING, Serializer.BYTE_ARRAY);
  }
}
origin: MartinHaeusler/chronos

protected static NavigableMap<String, Boolean> getMapInverseReadOnly(final MapDBTransaction tx,
    final String mapName) {
  checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!");
  checkNotNull(mapName, "Precondition violation - argument 'mapName' must not be NULL!");
  String inverseMapName = mapName + INVERSE_MATRIX_SUFFIX;
  if (tx.exists(inverseMapName) == false) {
    return Collections.emptyNavigableMap();
  } else {
    return tx.treeMap(inverseMapName, Serializer.STRING, Serializer.BOOLEAN);
  }
}
origin: org.apache.sshd/sshd-sftp

public static NavigableMap<String, String> toStringExtensions(Map<String, ?> extensions) {
  if (GenericUtils.isEmpty(extensions)) {
    return Collections.emptyNavigableMap();
  }
  // NOTE: even though extensions are probably case sensitive we do not allow duplicate name that differs only in case
  NavigableMap<String, String> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
  extensions.forEach((key, value) -> {
    ValidateUtils.checkNotNull(value, "No value for extension=%s", key);
    String prev = map.put(key, (value instanceof byte[]) ? new String((byte[]) value, StandardCharsets.UTF_8) : value.toString());
    ValidateUtils.checkTrue(prev == null, "Multiple values for extension=%s", key);
  });
  return map;
}
origin: org.apache.sshd/sshd-sftp

public static NavigableMap<String, byte[]> toBinaryExtensions(Map<String, String> extensions) {
  if (GenericUtils.isEmpty(extensions)) {
    return Collections.emptyNavigableMap();
  }
  // NOTE: even though extensions are probably case sensitive we do not allow duplicate name that differs only in case
  NavigableMap<String, byte[]> map = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
  extensions.forEach((key, value) -> {
    ValidateUtils.checkNotNull(value, "No value for extension=%s", key);
    byte[] prev = map.put(key, value.getBytes(StandardCharsets.UTF_8));
    ValidateUtils.checkTrue(prev == null, "Multiple values for extension=%s", key);
  });
  return map;
}
origin: org.apache.sshd/sshd-osgi

/**
 * @return A snapshot of the currently registered specialized {@link PublicKeyEntryDataResolver}-s,
 * where key=the key-type value (case <U>insensitive</U>) - e.g., &quot;ssh-rsa&quot;,
 * &quot;pgp-sign-dss&quot;, etc., value=the associated {@link PublicKeyEntryDataResolver}
 * for the key type
 */
public static NavigableMap<String, PublicKeyEntryDataResolver> getRegisteredKeyDataEntryResolvers() {
  NavigableMap<String, PublicKeyEntryDataResolver> decoders;
  synchronized (KEY_DATA_RESOLVERS) {
    if (KEY_DATA_RESOLVERS.isEmpty()) {
      return Collections.emptyNavigableMap();
    }
    decoders = new TreeMap<>(KEY_DATA_RESOLVERS.comparator());
    decoders.putAll(KEY_DATA_RESOLVERS);
  }
  return decoders;
}
origin: org.apache.sshd/sshd-sftp

protected NavigableMap<String, Object> readFileAttributes(Path file, String view, LinkOption... options) throws IOException {
  try {
    Map<String, ?> attrs = Files.readAttributes(file, view, options);
    if (GenericUtils.isEmpty(attrs)) {
      return Collections.emptyNavigableMap();
    }
    NavigableMap<String, Object> sorted = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
    sorted.putAll(attrs);
    return sorted;
  } catch (IOException e) {
    return handleReadFileAttributesException(file, view, options, e);
  }
}
origin: MartinHaeusler/chronos

private NavigableMap<Long, byte[]> getMapForReading(final MapDBTransaction tx) {
  checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!");
  String mapName = this.getBranchName() + MAP_SUFFIX;
  if (tx.exists(mapName)) {
    return Collections.unmodifiableNavigableMap(tx.treeMap(mapName, Serializer.LONG, Serializer.BYTE_ARRAY));
  } else {
    return Collections.emptyNavigableMap();
  }
}
origin: org.ogema.widgets/ogema-js-bundle

@Override
public NavigableMap<Long, ReceivedMessage> getMessages(MessageStatus status) {
  switch(status) {
  case CREATED:
    return Collections.unmodifiableNavigableMap(messages.unreadMessages);
  case READ:
    return Collections.unmodifiableNavigableMap(messages.readMessages);
  case DELETED:
    return Collections.unmodifiableNavigableMap(messages.deletedMessages);
  default: 
    return Collections.emptyNavigableMap();
  }
}
origin: org.apache.sshd/sshd-openpgp

/**
 * @param subKeys The {@link Subkey}-s to map - ignored if {@code null}/empty
 * @return A {@link NavigableMap} where key=the (case <U>insensitive</U>) fingerprint
 * value, value=the matching {@link Subkey}
 * @throws NullPointerException If key with {@code null} fingerprint encountered
 * @throws IllegalArgumentException If key with empty fingerprint encountered
 * @throws IllegalStateException If more than one key with same fingerprint found
 */
public static NavigableMap<String, Subkey> mapSubKeysByFingerprint(Collection<? extends Subkey> subKeys) {
  if (GenericUtils.isEmpty(subKeys)) {
    return Collections.emptyNavigableMap();
  }
  NavigableMap<String, Subkey> keysMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
  for (Subkey sk : subKeys) {
    String fp = ValidateUtils.checkNotNullAndNotEmpty(sk.getFingerprint(), "No fingerprint for %s", sk);
    Subkey prev = keysMap.put(fp, sk);
    ValidateUtils.checkState(prev == null, "Multiple sub-keys with fingerprint=%s: %s / %s", fp, sk, prev);
  }
  return keysMap;
}
origin: org.ogema.widgets/ogema-js-bundle

private NavigableMap<Long, ReceivedMessage> getMessages(long tm, MessageStatus status) {
  switch(status) {
  case SENT:
    return Collections.unmodifiableNavigableMap(messages.unreadMessages.tailMap(tm));
  case READ:
    return Collections.unmodifiableNavigableMap(messages.readMessages.tailMap(tm));
  case DELETED:
    return Collections.unmodifiableNavigableMap(messages.deletedMessages.tailMap(tm));
  default: 
    return Collections.emptyNavigableMap();
  }
}
 
origin: vmware/xenon

@Test
public void readPost111() throws IOException {
  String prefix = "post-1.1.1-";
  assertCollectionEqualAndUsable(Collections.emptyList(), readFileAndDeserialize(prefix + "emptyList"));
  assertCollectionEqualAndUsable(Arrays.asList("test"), readFileAndDeserialize(prefix + "asList"));
  assertCollectionEqualAndUsable(Collections.emptyMap(), readFileAndDeserialize(prefix + "emptyMap"));
  assertCollectionEqualAndUsable(Collections.emptyNavigableMap(),
      readFileAndDeserialize(prefix + "emptyNavigableMap"));
  assertCollectionEqualAndUsable(Collections.emptySortedMap(), readFileAndDeserialize(prefix + "emptySortedMap"));
  assertCollectionEqualAndUsable(Collections.emptySet(), readFileAndDeserialize(prefix + "emptySet"));
  assertCollectionEqualAndUsable(Collections.emptyNavigableSet(),
      readFileAndDeserialize(prefix + "emptyNavigableSet"));
  assertCollectionEqualAndUsable(Collections.emptySortedSet(), readFileAndDeserialize(prefix + "emptySortedSet"));
  assertCollectionEqualAndUsable(Collections.singleton("test"), readFileAndDeserialize(prefix + "singletonSet"));
  assertCollectionEqualAndUsable(Collections.singletonList("test"),
      readFileAndDeserialize(prefix + "singletonList"));
  assertCollectionEqualAndUsable(Collections.singletonMap("k", "v"),
      readFileAndDeserialize(prefix + "singletonMap"));
}
origin: vmware/xenon

@Test
public void testEmptyCollectionClone() {
  Object target;
  target = Collections.emptyList();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptySet();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptyMap();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptyNavigableMap();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptyNavigableSet();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptySortedMap();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptySortedSet();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
}
origin: com.vmware.xenon/xenon-common

@Test
public void testEmptyCollectionSerialization() {
  Object target;
  target = Collections.emptyList();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptySet();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptyMap();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptyNavigableMap();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptyNavigableSet();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptySortedMap();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptySortedSet();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
}
origin: vmware/xenon

@Test
public void testEmptyCollectionSerialization() {
  Object target;
  target = Collections.emptyList();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptySet();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptyMap();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptyNavigableMap();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptyNavigableSet();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptySortedMap();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
  target = Collections.emptySortedSet();
  assertCollectionEqualAndUsable(target, serAndDeser(target));
}
origin: com.vmware.xenon/xenon-common

@Test
public void testEmptyCollectionClone() {
  Object target;
  target = Collections.emptyList();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptySet();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptyMap();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptyNavigableMap();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptyNavigableSet();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptySortedMap();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
  target = Collections.emptySortedSet();
  assertCollectionEqualAndUsable(target, cloneWithKryo(target));
}
java.utilCollectionsemptyNavigableMap

Popular methods of Collections

  • emptyList
    Returns the empty list (immutable). This list is serializable.This example illustrates the type-safe
  • sort
  • singletonList
    Returns an immutable list containing only the specified object. The returned list is serializable.
  • unmodifiableList
    Returns an unmodifiable view of the specified list. This method allows modules to provide users with
  • emptyMap
    Returns the empty map (immutable). This map is serializable.This example illustrates the type-safe w
  • emptySet
    Returns the empty set (immutable). This set is serializable. Unlike the like-named field, this metho
  • unmodifiableMap
    Returns an unmodifiable view of the specified map. This method allows modules to provide users with
  • singleton
    Returns an immutable set containing only the specified object. The returned set is serializable.
  • unmodifiableSet
    Returns an unmodifiable view of the specified set. This method allows modules to provide users with
  • singletonMap
    Returns an immutable map, mapping only the specified key to the specified value. The returned map is
  • addAll
    Adds all of the specified elements to the specified collection. Elements to be added may be specifie
  • reverse
    Reverses the order of the elements in the specified list. This method runs in linear time.
  • addAll,
  • reverse,
  • unmodifiableCollection,
  • shuffle,
  • enumeration,
  • list,
  • synchronizedMap,
  • synchronizedList,
  • reverseOrder,
  • emptyIterator

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Top PhpStorm plugins
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