本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
示例13: shardType
import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
public @NonNullByDefault ShardType shardType() {
return ShardType.JSON;
}
示例14: S3OnlyQuery
import org.eclipse.jdt.annotation.NonNullByDefault; //导入依赖的package包/类
public @NonNullByDefault S3OnlyQuery(JSONObject settings) {
super("", columnsFor(settings));
_settings = settings;
}
示例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);
}