本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例7: getChanges
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
@Override
protected List<UnifiedDiffChange> getChanges() {
return ContainerUtil.notNullize(getDiffChanges());
}
示例8: getRefs
import com.intellij.util.containers.ContainerUtil; //导入方法依赖的package包/类
@NotNull
public Collection<String> getRefs() {
return ContainerUtil.notNullize((List<String>)myData.get(GitTestLogRecordInfo.REFS));
}