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


Java NonNullByDefault类代码示例

本文整理汇总了Java中org.eclipse.jdt.annotation.NonNullByDefault的典型用法代码示例。如果您正苦于以下问题:Java NonNullByDefault类的具体用法?Java NonNullByDefault怎么用?Java NonNullByDefault使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: compare

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@NonNullByDefault(false)
@Override
public int compare(final T o1, final T o2) {
  if (o1 == null) {
    if (o2 == null) {
      return 0;
    } else {
      return -1;
    }
  } else if (o2 == null) {
    return 1;
  } else {
    final String filteredProto1 = buildReplacementMessage(o1, replacer1).toString();
    final String filteredProto2 = buildReplacementMessage(o2, replacer2).toString();
    return filteredProto1.compareTo(filteredProto2);
  }
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:18,代码来源:Misc.java

示例2: equals

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@NonNullByDefault(false)
@Override
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof CompositePathMatcher)) {
    return false;
  }
  final CompositePathMatcher<?, ?> other = (CompositePathMatcher<?, ?>) obj;
  if (allowDirs != other.allowDirs) {
    return false;
  }
  if (allowFiles != other.allowFiles) {
    return false;
  }
  if (!matchers.equals(other.matchers)) {
    return false;
  }
  return true;
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:25,代码来源:ContextResourcePathMatchers.java

示例3: equals

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@NonNullByDefault(false)
@Override
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof PositionValue)) {
    return false;
  }
  PositionValue<?> other = (PositionValue<?>) obj;
  if (position != other.position) {
    return false;
  }
  if (!value.equals(other.value)) {
    return false;
  }
  return true;
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:22,代码来源:HistoryCaches.java

示例4: visitFile

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@Override
@NonNullByDefault(false)
public FileVisitResult visitFile(T file, BasicFileAttributes attrs) throws IOException {
  super.visitFile(file, attrs);
  @SuppressWarnings("null")
  final @NonNull T nonNullFile = file;

  if (matcher.matches(nonNullFile, pathContext)) {
    if (!result.add(nonNullFile) && !allowDuplicates) {
      @SuppressWarnings("null")
      final @NonNull String nonNullErrorMsg = String.format("found a duplicate file %s", 
          nonNullFile);
      errorMessage = nonNullErrorMsg;
      log.error(errorMessage);
      matcherCache.clear();
      return FileVisitResult.TERMINATE;
    }
  }

  return FileVisitResult.CONTINUE;
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:22,代码来源:PathVisitors.java

示例5: valueColumns

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
/**
 * Sql queries don't have types that we know of
 * @return
 */
public @NonNullByDefault List<ColumnDef> valueColumns() {
  List<ColumnDef> list = new ArrayList<>();
  for(int i=0;i<_aliases.size();i++) {
    JSONObject o = _aliases.getJSONObject(i);
    ColumnDef c = new ColumnDef("v" + i, DataType.UNKNOWN, o.getString("alias"));
    list.add(c);
  }
  return list;
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:14,代码来源:Query.java

示例6: columnsFor

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
static final @NonNullByDefault JSONArray columnsFor(final JSONObject settings) {
  final JSONArray columnArray = settings.getJSONArray("columns");
  if (columnArray == null) {
    throw new NullPointerException("columns should not be null!");
  }
  return columnArray;
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:8,代码来源:Query.java

示例7: setState

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
/***
 * 
 */
@NonNullByDefault
public void setState(String key, Object val) throws InterruptedException,
    CoordinationException {
  Universe.instance().state()
      .setState(operationStateKey() + SOURCE_STATE_KEY_PREFIX + key, val);
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:10,代码来源:Operation.java

示例8: compare

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@NonNullByDefault(false)
@Override
public int compare(final FileDescriptorProto o1, final FileDescriptorProto o2) {
  if (o1 == o2) {
    return 0;
  } else if (o1 == null) {
    return -1;
  } else if (o2 == null) {
    return 1;
  } else {
    final String filteredProto1 = buildFilteredProtoByPatterns(o1, skipPatterns).toString();
    final String filteredProto2 = buildFilteredProtoByPatterns(o2, skipPatterns).toString();
    return filteredProto1.compareTo(filteredProto2);
  }
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:16,代码来源:AbstractMessageUtils.java

示例9: equals

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@Override
@NonNullByDefault(false)
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof SimpleHierarchicalMatcher)) {
    return false;
  }
  final SimpleHierarchicalMatcher<?> other = (SimpleHierarchicalMatcher<?>) obj;
  if (allowDirs != other.allowDirs) {
    return false;
  }
  if (allowFiles != other.allowFiles) {
    return false;
  }
  if (isUnix != other.isUnix) {
    return false;
  }
  if (!pattern.pattern().equals(other.pattern.pattern())) {
    return false;
  }
  return true;
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:28,代码来源:ContextPathMatchers.java

示例10: preVisitDirectory

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@Override
@NonNullByDefault(false)
public FileVisitResult preVisitDirectory(T dir, BasicFileAttributes attrs)
    throws IOException {
  super.preVisitDirectory(dir, attrs); // dir, attrs are checked for nonNull!
  @SuppressWarnings("null")
  final @NonNull T nonNullDir = dir;
  //TODO either use or remove!
  @SuppressWarnings({ "unused", "null" })
  final @NonNull BasicFileAttributes nonNullAttrs = attrs;
  
  if (skipRoot) {
    skipRoot = false;
    return FileVisitResult.CONTINUE;
  } 
  
  matcherCache.push();
  final DirectoryMatchResult matcherResult = matcher.matchesDirectory(nonNullDir, pathContext);
  
  if (matcherResult.isMatched()) {
    if (!result.add(nonNullDir) && !allowDuplicates) {
      @SuppressWarnings("null")
      @NonNull String nonNullErrorMsg = String.format("found a duplicate folder %s", nonNullDir);
      errorMessage = nonNullErrorMsg;
      log.error(errorMessage);
      matcherCache.clear();
      return FileVisitResult.TERMINATE;
    }
  }
  
  if (matcherResult.isSkip()) {
    matcherCache.pop();
    return FileVisitResult.SKIP_SUBTREE;
  } else {
    return FileVisitResult.CONTINUE;
  }  
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:38,代码来源:PathVisitors.java

示例11: postVisitDirectory

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
@Override
@NonNullByDefault(false)
public FileVisitResult postVisitDirectory(T dir, IOException exc) throws IOException {
  super.postVisitDirectory(dir, exc);
  matcherCache.pop();
  return FileVisitResult.CONTINUE;
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:8,代码来源:PathVisitors.java

示例12: makeTestTree

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
private List<String> makeTestTree(final Path rootDir, final Iterable<String> subDirs,
    final Iterable<String> files) throws IOException {
  final Path realDir = Files.createDirectories(Objects.requireNonNull(rootDir));

  for (final String subDir : Objects.requireNonNull(subDirs)) {
    Files.createDirectories(realDir.resolve(Objects.requireNonNull(subDir)));
  }

  final List<String> allFiles = new ArrayList<>();
  Files.walkFileTree(rootDir, new SimpleFileVisitor<Path>() {
    @NonNullByDefault(false)
    @Override
    public FileVisitResult postVisitDirectory(final Path dir, final IOException exc)
        throws IOException {
      super.postVisitDirectory(dir, exc);

      if (!dir.equals(realDir)) {
        for (final String file : files) {
          final Path filePath = dir.resolve(file);

          if (Files.notExists(filePath)) {
            allFiles.add(Files.createFile(filePath).toAbsolutePath().toString());
          }
        }
      }

      return FileVisitResult.CONTINUE;
    }
  });

  Collections.sort(allFiles);
  return Collections.unmodifiableList(allFiles);
}
 
开发者ID:protobufel,项目名称:protobuf-el,代码行数:34,代码来源:ExecMojoTest.java

示例13: shardType

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
public @NonNullByDefault ShardType shardType() {
  return ShardType.JSON;
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:4,代码来源:Query.java

示例14: S3OnlyQuery

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
public @NonNullByDefault S3OnlyQuery(JSONObject settings) {
  super("", columnsFor(settings));
  _settings = settings;
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:5,代码来源:S3OnlyQuery.java

示例15: connect

import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
public @NonNullByDefault void connect(Operation source, Operation dest, String name) throws FlowCompilationException{
  this.graph().connect(source, dest, name);
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:4,代码来源:App.java


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