java.util.Collections.emptySortedSet()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中java.util.Collections.emptySortedSet()方法的一些代码示例,展示了Collections.emptySortedSet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collections.emptySortedSet()方法的具体详情如下:
包路径:java.util.Collections
类名称:Collections
方法名:emptySortedSet

Collections.emptySortedSet介绍

暂无

代码示例

代码示例来源:origin: google/guava

@Override
 public SortedSet<String> create(String[] elements) {
  return Collections.emptySortedSet();
 }
})

代码示例来源:origin: SonarSource/sonarqube

public SortedSet<String> languages(String moduleKey) {
 return languagesCache.getOrDefault(moduleKey, Collections.emptySortedSet());
}

代码示例来源:origin: AxonFramework/AxonFramework

/**
 * Returns a new {@link GapAwareTrackingToken} instance based on the given {@code index} and collection of {@code
 * gaps}.
 *
 * @param index the highest global sequence number of events up until (and including) this tracking token
 * @param gaps  global sequence numbers of events that have not been seen yet even though these sequence numbers are
 *              smaller than the current index. These missing sequence numbers may be filled in later when those
 *              events get committed to the store or may never be filled in if those events never get committed.
 * @return a new tracking token from given index and gaps
 */
@JsonCreator
public static GapAwareTrackingToken newInstance(@JsonProperty("index") long index,
                        @JsonProperty("gaps") Collection<Long> gaps) {
  if (gaps.isEmpty()) {
    return new GapAwareTrackingToken(index, Collections.emptySortedSet());
  }
  SortedSet<Long> gapSet = new ConcurrentSkipListSet<>(gaps);
  Assert.isTrue(gapSet.last() < index,
         () -> String.format("Gap indices [%s] should all be smaller than head index [%d]", gaps, index));
  return new GapAwareTrackingToken(index, gapSet);
}

代码示例来源:origin: SonarSource/sonarqube

private void writeProfiles(JsonWriter json, DbSession dbSession, ComponentDto component) {
 Set<QualityProfile> qualityProfiles = dbClient.liveMeasureDao().selectMeasure(dbSession, component.projectUuid(), QUALITY_PROFILES_KEY)
  .map(LiveMeasureDto::getDataAsString)
  .map(data -> QPMeasureData.fromJson(data).getProfiles())
  .orElse(emptySortedSet());
 Map<String, QProfileDto> dtoByQPKey = dbClient.qualityProfileDao().selectByUuids(dbSession, qualityProfiles.stream().map(QualityProfile::getQpKey).collect(Collectors.toList()))
  .stream()
  .collect(uniqueIndex(QProfileDto::getKee));
 json.name("qualityProfiles").beginArray();
 qualityProfiles.forEach(qp -> writeToJson(json, qp, !dtoByQPKey.containsKey(qp.getQpKey())));
 json.endArray();
}

代码示例来源:origin: wildfly/wildfly

classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass());
classes.add(Collections.checkedSortedMap(Collections.emptySortedMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedSortedSet(Collections.emptySortedSet(), Void.class).getClass());
classes.add(Collections.synchronizedSet(Collections.emptySet()).getClass());
classes.add(Collections.synchronizedSortedMap(Collections.emptySortedMap()).getClass());
classes.add(Collections.synchronizedSortedSet(Collections.emptySortedSet()).getClass());
classes.add(Collections.unmodifiableSet(Collections.emptySet()).getClass());
classes.add(Collections.unmodifiableSortedMap(Collections.emptySortedMap()).getClass());
classes.add(Collections.unmodifiableSortedSet(Collections.emptySortedSet()).getClass());

代码示例来源:origin: linkedin/cruise-control

/**
 * Get brokers that the rebalance process will go over to apply balancing actions to rep licas they contain.
 *
 * @param clusterModel The state of the cluster.
 * @return A collection of brokers that the rebalance process will go over to apply balancing actions to replicas
 * they contain.
 */
@Override
protected SortedSet<Broker> brokersToBalance(ClusterModel clusterModel) {
 if (!clusterModel.deadBrokers().isEmpty()) {
  return clusterModel.deadBrokers();
 }
 if (_currentRebalanceTopic == null) {
  return Collections.emptySortedSet();
 }
 // Brokers having over minimum number of replicas per broker for the current rebalance topic are eligible for balancing.
 SortedSet<Broker> brokersToBalance = new TreeSet<>();
 int minNumReplicasPerBroker = _replicaDistributionTargetByTopic.get(_currentRebalanceTopic).minNumReplicasPerBroker();
 brokersToBalance.addAll(clusterModel.brokers().stream()
   .filter(broker -> broker.replicasOfTopicInBroker(_currentRebalanceTopic).size() > minNumReplicasPerBroker)
   .collect(Collectors.toList()));
 return brokersToBalance;
}

代码示例来源:origin: SonarSource/sonarqube

.map(LiveMeasureDto::getDataAsString)
.map(data -> QPMeasureData.fromJson(data).getProfiles())
.orElse(emptySortedSet());

代码示例来源:origin: apache/hbase

ZKUtil.deleteNodeFailSilent(zookeeper, oldQueueNode);
  LOG.info("Removed empty {}/{}", sourceServerName, queueId);
  return new Pair<>(newQueueId, Collections.emptySortedSet());
 return new Pair<>(newQueueId, Collections.emptySortedSet());
} catch (KeeperException | InterruptedException e) {
 throw new ReplicationException("Claim queue queueId=" + queueId + " from " +

代码示例来源:origin: AxonFramework/AxonFramework

.boxed()
                .collect(Collectors.toCollection(TreeSet::new))
          : Collections.emptySortedSet()
  );
} else {

代码示例来源:origin: AxonFramework/AxonFramework

public StubTrackingEventStream(long... tokens) {
  GapAwareTrackingToken lastToken = GapAwareTrackingToken.newInstance(-1, emptySortedSet());
  eventMessages = new LinkedList<>();
  for (Long seq : tokens) {
    lastToken = lastToken.advanceTo(seq, 1000, true);
    eventMessages.add(new GenericTrackedEventMessage<>(lastToken, createEvent(seq)));
  }
}

代码示例来源:origin: AxonFramework/AxonFramework

.boxed()
                .collect(Collectors.toCollection(TreeSet::new))
          : Collections.emptySortedSet()
  );
} else {

代码示例来源:origin: linkedin/cruise-control

return Collections.emptySortedSet();
return Collections.emptySortedSet();

代码示例来源:origin: AxonFramework/AxonFramework

assertTrue(replayRun.get(0) instanceof ReplayToken);
assertTrue(replayRun.get(5) instanceof ReplayToken);
assertEquals(GapAwareTrackingToken.newInstance(6, emptySortedSet()), replayRun.get(6));

代码示例来源:origin: wildfly/wildfly

assertTrue(immutability.test(Collections.emptySet()));
assertTrue(immutability.test(Collections.emptySortedMap()));
assertTrue(immutability.test(Collections.emptySortedSet()));
assertTrue(immutability.test(Boolean.TRUE));
assertTrue(immutability.test(Character.valueOf('a')));

代码示例来源:origin: jshiell/checkstyle-idea

public static PluginConfigurationBuilder testInstance(final String checkstyleVersion) {
  return new PluginConfigurationBuilder(checkstyleVersion, ScanScope.AllSources, false, false,
      Collections.emptySortedSet(), Collections.emptyList(), null, false, "aVersion");
}

代码示例来源:origin: com.google.guava/guava-testlib

@Override
 public SortedSet<String> create(String[] elements) {
  return Collections.emptySortedSet();
 }
})

代码示例来源:origin: locationtech/geogig

@Override
  public SortedSet<Bucket> getBuckets() {
    return Collections.emptySortedSet();
  }
};

代码示例来源:origin: locationtech/geogig

static RevTree build(final long size, final int childTreeCount, @Nullable List<Node> trees,
    @Nullable List<Node> features, @Nullable SortedSet<Bucket> buckets) {
  trees = trees == null ? Collections.emptyList() : trees;
  features = features == null ? Collections.emptyList() : features;
  buckets = buckets == null ? Collections.emptySortedSet() : buckets;
  ObjectId id = HashObjectFunnels.hashTree(trees, features, buckets);
  if (buckets.isEmpty()) {
    return RevObjectFactory.defaultInstance().createTree(id, size, trees, features);
  }
  return RevObjectFactory.defaultInstance().createTree(id, size, childTreeCount, buckets);
}

代码示例来源:origin: batfish/batfish

@Override
@Nonnull
public SortedSet<Edge> getEdgeBlacklist(@Nonnull NetworkSnapshot networkSnapshot) {
 SortedSet<Edge> blacklistEdges =
   _storage.loadEdgeBlacklist(networkSnapshot.getNetwork(), networkSnapshot.getSnapshot());
 if (blacklistEdges == null) {
  return Collections.emptySortedSet();
 }
 return blacklistEdges;
}

代码示例来源:origin: org.onehippo.cms7/hippo-cms-api

static SortedSet<Node> getReferrersSortedByName(Node handle, final boolean retrieveUnpublished) throws RepositoryException {
  if (handle.isNodeType(HippoNodeType.NT_DOCUMENT)) {
    handle = handle.getParent();
  }
  if (!handle.isNodeType(HippoNodeType.NT_HANDLE)) {
    return Collections.emptySortedSet();
  }
  final Map<String, Node> referrers = WorkflowUtils.getReferringDocuments(handle, retrieveUnpublished);
  return getSortedReferrers(referrers.values());
}

相关文章

Collections类方法