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


Java ObjectUtil.NULL属性代码示例

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


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

示例1: getData

@Override
@SuppressWarnings("unchecked")
public <T> T getData(@Nonnull Key<T> dataId) {
  int currentEventCount = IdeEventQueue.getInstance().getEventCount();
  if (myEventCount != -1 && myEventCount != currentEventCount) {
    LOG.error("cannot share data context between Swing events; initial event count = " + myEventCount + "; current event count = " + currentEventCount);
    return doGetData(dataId);
  }

  if (ourSafeKeys.contains(dataId)) {
    Object answer = myCachedData.get(dataId);
    if (answer == null) {
      answer = doGetData(dataId);
      myCachedData.put(dataId, answer == null ? ObjectUtil.NULL : answer);
    }
    return answer != ObjectUtil.NULL ? (T)answer : null;
  }
  else {
    return doGetData(dataId);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:DataManagerImpl.java

示例2: findPackage

@RequiredReadAction
@Nullable
@Override
public PsiPackage findPackage(@Nonnull String qualifiedName, @Nonnull Class<? extends ModuleExtension> extensionClass) {
  ConcurrentMap<String, Object> map = myPackageCache.get(extensionClass);
  if (map != null) {
    final Object value = map.get(qualifiedName);
    // if we processed - but not found package
    if (value == ObjectUtil.NULL) {
      return null;
    }
    else if (value != null) {
      return (PsiPackage)value;
    }
  }

  PsiPackage newPackage = createPackage(qualifiedName, extensionClass);

  Object valueForInsert = ObjectUtil.notNull(newPackage, ObjectUtil.NULL);

  myPackageCache.computeIfAbsent(extensionClass, aClass -> ContainerUtil.newConcurrentMap()).putIfAbsent(qualifiedName, valueForInsert);

  return newPackage;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:PsiPackageManagerImpl.java

示例3: findExtensionMethodGroupByName

@RequiredReadAction
@Nullable
@Override
@SuppressWarnings("unchecked")
public CSharpElementGroup<CSharpMethodDeclaration> findExtensionMethodGroupByName(@NotNull String name)
{
	Object o = myExtensionGroups.get(name);
	return o == ObjectUtil.NULL ? null : (CSharpElementGroup<CSharpMethodDeclaration>) o;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:9,代码来源:CSharpNamespaceResolveContext.java

示例4: findCompositeType

@RequiredReadAction
@Nullable
public static CSharpCompositeTypeDeclaration findCompositeType(@NotNull CSharpTypeDeclaration parent)
{
	Object cachedValue = CachedValuesManager.getCachedValue(parent, () -> CachedValueProvider.Result.create(findCompositeTypeImpl(parent), PsiModificationTracker
			.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT));
	return cachedValue == ObjectUtil.NULL ? null : (CSharpCompositeTypeDeclaration) cachedValue;
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:8,代码来源:CSharpCompositeTypeDeclaration.java

示例5: getValue

@Nullable
public final T getValue(H h) {
  T data = h.getUserData(this);
  if (data == null) {
    data = myFunction.fun(h);
    h.putUserData(this, data == null ? (T)ObjectUtil.NULL : data);
  }
  return data == ObjectUtil.NULL ? null : data;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:NullableLazyKey.java

示例6: canNavigateToTypeSource

@Override
public boolean canNavigateToTypeSource()
{
	return myTypeProxy != ObjectUtil.NULL;
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:5,代码来源:AbstractTypedValueNode.java


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