org.apache.brooklyn.util.collections.MutableSet.addIfNotNull()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(66)

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

MutableSet.addIfNotNull介绍

暂无

代码示例

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

public static RegisteredTypeLoadingContext alreadyEncountered(Set<String> encounteredTypeSymbolicNames, String anotherEncounteredType) {
  BasicRegisteredTypeLoadingContext result = new BasicRegisteredTypeLoadingContext();
  MutableSet<String> encounteredTypes = MutableSet.copyOf(encounteredTypeSymbolicNames);
  encounteredTypes.addIfNotNull(anotherEncounteredType);
  result.encounteredTypes = encounteredTypes.asUnmodifiable();
  return result;
}

代码示例来源:origin: org.apache.brooklyn/brooklyn-utils-common

MutableSet<InetAddress> candidates = new MutableSet<>();
if (prefer127) {
  candidates.addIfNotNull(addrs.get("127.0.0.1"));

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

@Override
protected synchronized void onRequesting() {
  if (!owningTasks.isEmpty() || !requestingTasks.isEmpty()) {
    Tasks.setBlockingTask( !requestingTasks.isEmpty() ? Iterables.getLast(requestingTasks) : Iterables.getFirst(owningTasks, null) );
    Tasks.setBlockingDetails("Waiting on semaphore "+getName()+" ("+getDescription()+"); "
      + "queued at "+Time.makeDateString()+" when "+getRequestingThreads().size()+" ahead in queue");
  }
  requestingTasks.addIfNotNull(Tasks.current());
  super.onRequesting();
}

代码示例来源:origin: org.apache.brooklyn/brooklyn-core

protected Function<SensorEvent<T>, U> getTransformation() {
  MutableSet<Object> suppliers = MutableSet.of();
  suppliers.addIfNotNull(config().getRaw(TARGET_VALUE).orNull());
  suppliers.addIfNotNull(config().getRaw(TRANSFORMATION_FROM_EVENT).orNull());
  suppliers.addIfNotNull(config().getRaw(TRANSFORMATION_FROM_VALUE).orNull());
  checkArgument(suppliers.size()==1,  
    "Must set exactly one of: %s, %s, %s", TARGET_VALUE.getName(), TRANSFORMATION_FROM_VALUE.getName(), TRANSFORMATION_FROM_EVENT.getName());

相关文章