当前位置: 首页>>代码示例>>Java>>正文


Java ContainerUtil.notNullize方法代码示例

本文整理汇总了Java中com.intellij.util.containers.ContainerUtil.notNullize方法的典型用法代码示例。如果您正苦于以下问题:Java ContainerUtil.notNullize方法的具体用法?Java ContainerUtil.notNullize怎么用?Java ContainerUtil.notNullize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.util.containers.ContainerUtil的用法示例。


在下文中一共展示了ContainerUtil.notNullize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getComponentInstancesOfType

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
public final <T> List<T> getComponentInstancesOfType(@NotNull Class<T> baseClass) {
  List<T> result = null;
  // we must use instances only from our adapter (could be service or extension point or something else)
  for (ComponentAdapter componentAdapter : ((DefaultPicoContainer)getPicoContainer()).getComponentAdapters()) {
    if (componentAdapter instanceof ComponentConfigComponentAdapter && ReflectionUtil.isAssignable(baseClass, componentAdapter.getComponentImplementation())) {
      //noinspection unchecked
      T instance = (T)((ComponentConfigComponentAdapter)componentAdapter).myInitializedComponentInstance;
      if (instance != null) {
        if (result == null) {
          result = new ArrayList<T>();
        }
        result.add(instance);
      }
    }
  }
  return ContainerUtil.notNullize(result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ComponentManagerImpl.java

示例2: getConfigurationsList

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
/**
 * Template configuration is not included
 */
@Override
@NotNull
public List<RunConfiguration> getConfigurationsList(@NotNull ConfigurationType type) {
  List<RunConfiguration> result = null;
  for (RunnerAndConfigurationSettings settings : getSortedConfigurations()) {
    RunConfiguration configuration = settings.getConfiguration();
    if (type.getId().equals(configuration.getType().getId())) {
      if (result == null) {
        result = new SmartList<RunConfiguration>();
      }
      result.add(configuration);
    }
  }
  return ContainerUtil.notNullize(result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:RunManagerImpl.java

示例3: readStepsBeforeRun

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private List<BeforeRunTask> readStepsBeforeRun(@Nullable Element child, @NotNull RunnerAndConfigurationSettings settings) {
  List<BeforeRunTask> result = null;
  if (child != null) {
    for (Element methodElement : child.getChildren(OPTION)) {
      Key<? extends BeforeRunTask> id = getProviderKey(methodElement.getAttributeValue(NAME_ATTR));
      BeforeRunTask beforeRunTask = getProvider(id).createTask(settings.getConfiguration());
      if (beforeRunTask != null) {
        beforeRunTask.readExternal(methodElement);
        if (result == null) {
          result = new SmartList<BeforeRunTask>();
        }
        result.add(beforeRunTask);
      }
    }
  }
  return ContainerUtil.notNullize(result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:RunManagerImpl.java

示例4: createListenersFor

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public static List<ColorPickerListener> createListenersFor(@Nullable PsiElement element) {
  List<ColorPickerListener> listeners = null;
  for (ColorPickerListenerFactory factory : EP_NAME.getExtensions()) {
    ColorPickerListener listener = factory.createListener(element);
    if (listener != null) {
      if (listeners == null) {
        listeners = new SmartList<ColorPickerListener>();
      }
      listeners.add(listener);
    }
  }
  return ContainerUtil.notNullize(listeners);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ColorPickerListenerFactory.java

示例5: getConfigurables

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
private static List<Configurable> getConfigurables(@NotNull DebuggerSettingsCategory category, @NotNull DebuggerConfigurableProvider[] providers) {
  List<Configurable> configurables = null;
  for (DebuggerConfigurableProvider provider : providers) {
    Collection<? extends Configurable> providerConfigurables = provider.getConfigurables(category);
    if (!providerConfigurables.isEmpty()) {
      if (configurables == null) {
        configurables = new SmartList<Configurable>();
      }
      configurables.addAll(providerConfigurables);
    }
  }
  return ContainerUtil.notNullize(configurables);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DebuggerConfigurable.java

示例6: getStableConfigurations

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
Collection<RunnerAndConfigurationSettings> getStableConfigurations(boolean shared) {
  List<RunnerAndConfigurationSettings> result = null;
  for (RunnerAndConfigurationSettings configuration : myConfigurations.values()) {
    if (!configuration.isTemporary() && isConfigurationShared(configuration) == shared) {
      if (result == null) {
        result = new SmartList<RunnerAndConfigurationSettings>();
      }
      result.add(configuration);
    }
  }
  return ContainerUtil.notNullize(result);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:RunManagerImpl.java

示例7: getChanges

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected List<UnifiedDiffChange> getChanges() {
  return ContainerUtil.notNullize(getDiffChanges());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:UnifiedDiffViewer.java

示例8: getRefs

import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public Collection<String> getRefs() {
  return ContainerUtil.notNullize((List<String>)myData.get(GitTestLogRecordInfo.REFS));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:GitLogParserTest.java


注:本文中的com.intellij.util.containers.ContainerUtil.notNullize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。