de.unkrig.commons.nullanalysis.Nullable.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中de.unkrig.commons.nullanalysis.Nullable.<init>()方法的一些代码示例,展示了Nullable.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Nullable.<init>()方法的具体详情如下:
包路径:de.unkrig.commons.nullanalysis.Nullable
类名称:Nullable
方法名:<init>

Nullable.<init>介绍

暂无

代码示例

代码示例来源:origin: de.unkrig/de-unkrig-commons

Command(CommandCode code, @Nullable String argument) {
    this.code     = code;
    this.argument = argument;
  }
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

/**
 * @return An {@link InputStream} producing the contents of the resource, or {@code null} iff the resource cannot
 *         be accessed.
 */
@Nullable InputStream
retrieve(String resourceName) throws IOException;

代码示例来源:origin: de.unkrig.commons/commons-lang

/**
 * Verifies that the <var>subject</var> is not {@code null}.
 *
 * @return The <var>subject</var>
 * @throws NullPointerException with the given <var>message</var> iff the <var>subject</var> is {@code null}
 */
public static <T> T
notNull(@Nullable T subject, String message) {
  if (subject == null) throw new NullPointerException(message);
  return subject;
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override @Nullable public synchronized Boolean
  produce() {
    long now = System.currentTimeMillis();
    if (now >= this.expirationTime) {
      this.expirationTime = now + interval;
      return true;
    } else {
      return false;
    }
  }
};

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override public boolean
  evaluate(@Nullable Token<TokenType> token) {
    return token == null || !JavaScanner.IGNORABLES.contains(token.type);
  }
});

代码示例来源:origin: de.unkrig.commons/commons-lang

/**
 * @return {@code null} iff the named category is unknown
 */
@Nullable public static Predicate<Integer>
unicodeCategoryFromName(String name) {
  return Characters.UNICODE_CATEGORIES.get(name.toUpperCase(Locale.US));
}
private static final Map<String /*name*/, Predicate<Integer>> UNICODE_CATEGORIES;

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override @Nullable public Object
get(@Nullable Object key) {
  assert key instanceof String;
  Object result = this.get((String) key);
  return result == this ? null : result;
}

代码示例来源:origin: de.unkrig.commons/commons-lang

private static void
saveKeyStoreToFile(KeyStore keyStore, File keyStoreFile, @Nullable char[] keyStorePassword)
throws GeneralSecurityException, IOException {
  OutputStream os = new FileOutputStream(keyStoreFile);
  try {
    keyStore.store(os, keyStorePassword);
    os.close();
  } finally {
    try { os.close(); } catch (Exception e) {}
  }
}

代码示例来源:origin: de.unkrig.commons/commons-lang

/**
 * Equivalent with {@link #getSubresources(ClassLoader, String, boolean, boolean)} with the <var>recurse</var>
 * parameter set to {@code true}.
 */
public static Map<String, URL>
getSubresources(@Nullable ClassLoader classLoader, String name, boolean includeDirectories) throws IOException {
  return ClassLoaders.getSubresources(classLoader, name, includeDirectories, true);
}

代码示例来源:origin: de.unkrig.commons/commons-util

@Override public boolean
containsKey(@Nullable Object key) {
  for (int i = this.size - 1; i >= 0; i--) {
    if (this.keysEqual(this.keys[i], key)) return true;
  }
  return false;
}

代码示例来源:origin: de.unkrig.commons/commons-util

@Override public boolean
containsValue(@Nullable Object value) {
  for (int i = this.size - 1; i >= 0; i--) {
    if (this.valuesEqual(this.values[i], value)) return true;
  }
  return false;
}

代码示例来源:origin: de.unkrig.commons/commons-util

/**
 * Changes the duration of this interval.
 *
 * @return                       This object
 * @throws IllegalStateException The <var>duration</var> is inconsistent with this object's beginning and ending,
 *                               i.e. all three are non-{@code null}, and beginning + duration != ending
 */
public TimeInterval
setDuration(@Nullable Duration duration) { this.duration = duration; this.checkConsistency(); return this; }

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override public int
  read(@Nullable char[] cbuf, int off, int len) throws IOException {
    assert cbuf != null;

    int count = super.read(cbuf, off, len);
    if (count > 0) this.out.write(cbuf, off, count);
    if (count == 0) this.out.flush();

    return count;
  }
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override public int
  compare(@Nullable Doc d1, @Nullable Doc d2) {
    if (d1 == null) return d2 == null ? 0 : 1;
    if (d2 == null) return -1;
    return d1.name().compareToIgnoreCase(d2.name());
  }
};

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override @Nullable public Void
  run(InputStream in, OutputStream out) throws IOException {
    this.transformer.transform(this.name, in, out);
    return null;
  }
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

/** @return The values of all parameters with the given {@code name} */
@Nullable public String[]
getParameter(String name) throws IOException {
  this.getParameterMap();
  List<String> l = this.getParameterMap().get(name);
  return l == null ? null : l.toArray(new String[l.size()]);
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

/**
 * @return The annotation with the given <var>annotationType</var>, or {@code null} iff the <var>doc</var> is
 *         not annotated with the <var>annotationType</var>
 */
@Nullable public static AnnotationDesc
get(ProgramElementDoc doc, ClassDoc annotationType) {
  for (AnnotationDesc ad : doc.annotations()) {
    if (ad.annotationType().equals(annotationType)) return ad;
  }
  return null;
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override @Nullable public T
  produce() {
    if (condition.evaluate(subject)) this.product = delegate.produce();
    return this.product;
  }
};

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override public boolean
  evaluate(@Nullable Token<TokenType> token) {
    return token == null || token.type.ordinal() > TokenType.END_OF_IGNORABLES.ordinal();
  }
});

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override @Nullable public String
replace(String subject) {
  String replacement = pattern.replace(subject);
  return replacement != null && predicate.evaluate(subject) ? replacement : null;
}

相关文章