本文整理匯總了Java中org.jetbrains.annotations.NotNull類的典型用法代碼示例。如果您正苦於以下問題:Java NotNull類的具體用法?Java NotNull怎麽用?Java NotNull使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NotNull類屬於org.jetbrains.annotations包,在下文中一共展示了NotNull類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addRecordTargetVariablesRecursive
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
private static void addRecordTargetVariablesRecursive(@NotNull AppleScriptTargetRecordLiteral targetRecord,
@NotNull List<AppleScriptTargetVariable> targetVariables) {
for (AppleScriptObjectTargetPropertyDeclaration property : targetRecord.getObjectTargetPropertyDeclarationList()) {
AppleScriptTargetVariable innerVariable = property.getTargetVariable();
AppleScriptTargetListLiteral innerList = property.getTargetListLiteral();
AppleScriptTargetRecordLiteral innerRecord = property.getTargetRecordLiteral();
if (innerVariable != null) {
targetVariables.add(innerVariable);
}
if (innerList != null) {
targetVariables.addAll(innerList.getTargetVariableList());
}
if (innerRecord != null) {
addRecordTargetVariablesRecursive(innerRecord, targetVariables);
}
}
}
示例2: copyFile
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
private static void copyFile(@NotNull File source, @NotNull File dir) throws IOException
{
//noinspection ResultOfMethodCallIgnored
dir.mkdirs();
File dest = new File(dir, source.getName());
if (dest.exists())
{
//noinspection ResultOfMethodCallIgnored
dest.delete();
}
//noinspection ResultOfMethodCallIgnored
dest.createNewFile();
try (InputStream is = new FileInputStream(source); OutputStream os = new FileOutputStream(dest))
{
byte[] buffer = new byte[BUFFER_SIZE];
int length;
while ((length = is.read(buffer)) > 0)
{
os.write(buffer, 0, length);
}
}
}
示例3: registerReferenceProviders
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
// TODO
registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiLiteralExpression.class),
new PsiReferenceProvider() {
@NotNull
@Override
public PsiReference[] getReferencesByElement(@NotNull PsiElement element,
@NotNull ProcessingContext
context) {
PsiLiteralExpression literalExpression = (PsiLiteralExpression) element;
String value = literalExpression.getValue() instanceof String ?
(String) literalExpression.getValue() : null;
if (value != null && value.startsWith("simple" + ":")) {
return new PsiReference[]{
new CptReference(element, new TextRange(8, value.length() + 1))};
}
return PsiReference.EMPTY_ARRAY;
}
});
}
示例4: visit
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@NotNull
@Override
public Type visit(For node, State s) {
bindIter(s, node.target, node.iter, SCOPE);
Type t1 = Types.UNKNOWN;
Type t2 = Types.UNKNOWN;
Type t3 = Types.UNKNOWN;
State s1 = s.copy();
State s2 = s.copy();
if (node.body != null) {
t1 = visit(node.body, s1);
s.merge(s1);
t2 = visit(node.body, s1);
s.merge(s1);
}
if (node.orelse != null) {
t3 = visit(node.orelse, s2);
s.merge(s2);
}
return UnionType.union(UnionType.union(t1, t2), t3);
}
示例5: KubeCloudClient
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
public KubeCloudClient(@Nullable String serverUuid,
@NotNull String cloudProfileId,
@NotNull KubeApiConnector apiConnector,
@NotNull List<KubeCloudImage> images,
@NotNull KubeCloudClientParametersImpl kubeClientParams,
@NotNull BuildAgentPodTemplateProviders podTemplateProviders,
@NotNull KubeDataCache cache,
@NotNull KubeBackgroundUpdater updater) {
myServerUuid = serverUuid;
myCloudProfileId = cloudProfileId;
myApiConnector = apiConnector;
myImageIdToImageMap = new ConcurrentHashMap<>(Maps.uniqueIndex(images, CloudImage::getId));
myKubeClientParams = kubeClientParams;
myPodTemplateProviders = podTemplateProviders;
myCache = cache;
myUpdater = updater;
myUpdater.registerClient(this);
}
示例6: createItem
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@NotNull
@Override
public TransformationMenuItem createItem(@NotNull TransformationMenuContext context) {
String description;
try {
description = "submenu " + getText(context);
} catch (Throwable t) {
return super.createItem(context);
}
context.getEditorMenuTrace().pushTraceInfo();
context.getEditorMenuTrace().setDescriptor(new EditorMenuDescriptorBase(description, new SNodePointer("r:7c1e5bbb-2d18-4cf3-a11d-502be6b13261(jetbrains.mps.samples.VoiceMenu.editor)", "8517997849287913434")));
try {
return super.createItem(context);
} finally {
context.getEditorMenuTrace().popTraceInfo();
}
}
示例7: getPresentation
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@NotNull
@Override
public ItemPresentation getPresentation() {
return new ItemPresentation() {
@Nullable
@Override
public String getPresentableText() {
return presText;
}
@Nullable
@Override
public String getLocationString() {
return null;
}
@Nullable
@Override
public Icon getIcon(boolean b) {
return PlatformIcons.CLASS_ICON;
}
};
}
示例8: getTargetPlaceholder
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@Override
protected AnswerPlaceholder getTargetPlaceholder(@NotNull final TaskFile taskFile, int offset) {
final AnswerPlaceholder selectedAnswerPlaceholder = taskFile.getAnswerPlaceholder(offset);
final List<AnswerPlaceholder> placeholders = taskFile.getActivePlaceholders();
if (selectedAnswerPlaceholder == null) {
for (AnswerPlaceholder placeholder : placeholders) {
if (placeholder.getOffset() > offset) {
return placeholder;
}
}
}
else {
int index = selectedAnswerPlaceholder.getIndex();
if (StudyUtils.indexIsValid(index, placeholders)) {
int newIndex = index + 1;
return placeholders.get(newIndex == placeholders.size() ? 0 : newIndex);
}
}
return null;
}
示例9: getExpandedRows
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@NotNull
private Set<Integer> getExpandedRows() {
Set<Integer> expanded = new HashSet<>(tree1.getRowCount());
for (int i = 0; i < tree1.getRowCount(); i++) {
if (tree1.isExpanded(i)) {
expanded.add(i);
}
}
return expanded;
}
開發者ID:waarneembemiddeling,項目名稱:intellij-circleci-integration,代碼行數:11,代碼來源:RecentBuildsToolWindowFactory.java
示例10: createContent
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@Override
@FXThread
protected void createContent(@NotNull final VBox root) {
imageView = new ImageView();
FXUtils.addToPane(imageView, root);
FXUtils.addClassTo(root, CSSClasses.IMAGE_VIEW_EDITOR_CONTAINER);
}
示例11: begin
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@Override
public @NotNull Stopwatch begin(@NotNull Stopwatch submittedStopwatch) {
tasks.queued.dec();
tasks.used.inc();
time.delay.observe(submittedStopwatch.stop());
return submittedStopwatch;
}
示例12: invokeSpecial0
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@Override
protected <T> T invokeSpecial0(@NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
int methodIndex = BH_METHODS.indexOf(method);
if (methodIndex < 0) {
throw new BHMethodNotFoundException(this, method);
}
switch (methodIndex) {
case 0:
return (T) ((SNode) GeefOvergang_id2hDGrbWPFpO(node));
default:
throw new BHMethodNotFoundException(this, method);
}
}
示例13: getPrevNonWhitespaceElement
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@Nullable
@Contract(pure = true)
public static PsiElement getPrevNonWhitespaceElement(@NotNull final PsiElement element) {
Validate.notNull(element);
PsiElement prevSibling = element.getPrevSibling();
while (null != prevSibling && (isWhiteSpace(prevSibling) || isLineBreak(prevSibling))) {
prevSibling = prevSibling.getPrevSibling();
}
return prevSibling;
}
示例14: collectPluginOptionKeys
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
@NotNull
private static Set<String> collectPluginOptionKeys() {
Set<String> result = new HashSet<>();
for (Field field : TrauteConstants.class.getFields()) {
int modifiers = field.getModifiers();
if ((modifiers & PUBLIC) == 0 || (modifiers & STATIC) == 0 || (modifiers & FINAL) == 0
|| field.getType() != String.class)
{
continue;
}
try {
String value = field.get(null).toString();
if (!value.contains("traute")) {
continue;
}
if (field.getName().contains("PREFIX")) {
for (InstrumentationType type : InstrumentationType.values()) {
result.add(value + type.getShortName());
}
} else {
result.add(value);
}
} catch (IllegalAccessException e) {
throw new RuntimeException(String.format(
"Unexpected exception on attempt to collect plugin option keys for %s.%s",
TrauteConstants.class.getName(), field.getName()
), e);
}
}
return result;
}
示例15: printInstrumentationResults
import org.jetbrains.annotations.NotNull; //導入依賴的package包/類
private void printInstrumentationResults(@NotNull JavaFileObject file,
@NotNull StatsCollector statsCollector,
@NotNull TrautePluginLogger logger)
{
ConcurrentMap<InstrumentationType, Long> stats = statsCollector.getStats();
long totalInstrumentationsNumber = stats.entrySet()
.stream()
.mapToLong(Map.Entry::getValue)
.sum();
if (totalInstrumentationsNumber <= 0) {
return;
}
StringBuilder details = new StringBuilder();
for (InstrumentationType type : InstrumentationType.values()) {
Long count = stats.get(type);
if (count != null) {
details.append(type).append(": ").append(count).append(", ");
}
}
details.setLength(details.length() - 2);
String fileName = file.toUri().getSchemeSpecificPart();
while (fileName.startsWith("//")) {
fileName = fileName.substring(1);
}
logger.info(String.format(
"added %d instrumentation%s to the class %s - %s",
totalInstrumentationsNumber, totalInstrumentationsNumber > 1 ? "s" : "", fileName, details)
);
}