當前位置: 首頁>>代碼示例>>Java>>正文


Java Nullable類代碼示例

本文整理匯總了Java中org.jetbrains.annotations.Nullable的典型用法代碼示例。如果您正苦於以下問題:Java Nullable類的具體用法?Java Nullable怎麽用?Java Nullable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Nullable類屬於org.jetbrains.annotations包,在下文中一共展示了Nullable類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertListNode

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Nullable
private List<Node> convertListNode(@Nullable Object o) {
    if (o == null) {
        return null;
    } else {
        List<Map<String, Object>> in = (List<Map<String, Object>>) o;
        List<Node> out = new ArrayList<>();

        for (Map<String, Object> m : in) {
            Node n = convert(m);
            if (n != null) {
                out.add(n);
            }
        }

        return out;
    }
}
 
開發者ID:lebronzj,項目名稱:pysonar2,代碼行數:19,代碼來源:Parser.java

示例2: RobotMap

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@JsonCreator
public RobotMap(@NotNull List<CommandButton> buttons, @Nullable SubsystemSolenoid shooter, @Nullable Pneumatics pneumatics,
                @Nullable IntakeSingleRollerPneumatic intake,
                @NotNull @JsonProperty(required = true) Logger logger,
                @NotNull @JsonProperty(required = true) MappedRunnable updater,
                @NotNull @JsonProperty(required = true) DriveTalonCluster drive,
                @NotNull @JsonProperty(required = true) OI oi,
                @NotNull @JsonProperty(required = true) YamlCommand defaultDriveCommand,
                @Nullable YamlCommand startupCommand){
	this.buttons = buttons;
	this.intake = intake;
	this.shooter = shooter;
	this.pneumatics = pneumatics;
	this.logger = logger;
	this.updater = updater;
	this.drive = drive;
	this.oi = oi;
	this.defaultDriveCommand = defaultDriveCommand.getCommand();
	this.startupCommand = startupCommand != null ? startupCommand.getCommand() : null;
}
 
開發者ID:PB020,項目名稱:Ballbasaur-Code-Rewrite,代碼行數:21,代碼來源:RobotMap.java

示例3: createItem

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Nullable
protected TransformationMenuItem createItem(TransformationMenuContext context) {
  WorkSpace_TransformationMenu.TMP_SubMenu_tva3ah_c0.TMP_Action_tva3ah_b2a.Item item = new WorkSpace_TransformationMenu.TMP_SubMenu_tva3ah_c0.TMP_Action_tva3ah_b2a.Item(context);
  String description;
  try {
    description = "single item: " + item.getLabelText("");
  } catch (Throwable t) {
    Logger.getLogger(getClass()).error("Exception while executing getText of the item " + item, t);
    return null;
  }
  context.getEditorMenuTrace().pushTraceInfo();
  try {
    context.getEditorMenuTrace().setDescriptor(new EditorMenuDescriptorBase(description, new SNodePointer("r:7c1e5bbb-2d18-4cf3-a11d-502be6b13261(jetbrains.mps.samples.VoiceMenu.editor)", "8720745441960174133")));
    item.setTraceInfo(context.getEditorMenuTrace().getTraceInfo());
  } finally {
    context.getEditorMenuTrace().popTraceInfo();
  }
  return item;
}
 
開發者ID:vaclav,項目名稱:voicemenu,代碼行數:20,代碼來源:WorkSpace_TransformationMenu.java

示例4: findSiblingByPredicate

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Nullable
@Contract("null, _ -> null")
public static PsiElement findSiblingByPredicate(
    @Nullable final PsiElement sibling,
    @NotNull final Predicate<PsiElement> predicate
) {
    if (sibling == null) {
        return null;
    } else {
        for (PsiElement child = sibling.getNextSibling(); child != null; child = child.getNextSibling()) {
            if (predicate.apply(child)) {
                return child;
            }
        }

        return null;
    }
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:19,代碼來源:ImpexPsiUtils.java

示例5: getState

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Nullable
@Override
public Element getState() {
    synchronized (lock) {
        final Element element = new Element("state");

        for (Entity entity : queue) {
            final Element entityElement = new Element(TAG_ENTITY);
            entityElement.setAttribute(ATTR_ACTION, entity.getAction().name());
            entityElement.setAttribute(ATTR_DATE, entity.getDateStr());
            final String parameters = entity.getParameters();

            if (parameters != null) {
                entityElement.setAttribute(ATTR_NAME, parameters);
            }
            element.addContent(entityElement);
        }
        return element;
    }
}
 
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:21,代碼來源:DefaultStatsCollector.java

示例6: createItem

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Nullable
protected TransformationMenuItem createItem(TransformationMenuContext context) {
  Activity_TransformationMenu.TMP_SubMenu_rgk9zw_a2.TMP_Action_rgk9zw_b0c.Item item = new Activity_TransformationMenu.TMP_SubMenu_rgk9zw_a2.TMP_Action_rgk9zw_b0c.Item(context);
  String description;
  try {
    description = "single item: " + item.getLabelText("");
  } catch (Throwable t) {
    Logger.getLogger(getClass()).error("Exception while executing getText of the item " + item, t);
    return null;
  }
  context.getEditorMenuTrace().pushTraceInfo();
  try {
    context.getEditorMenuTrace().setDescriptor(new EditorMenuDescriptorBase(description, new SNodePointer("r:7c1e5bbb-2d18-4cf3-a11d-502be6b13261(jetbrains.mps.samples.VoiceMenu.editor)", "8720745441970421370")));
    item.setTraceInfo(context.getEditorMenuTrace().getTraceInfo());
  } finally {
    context.getEditorMenuTrace().popTraceInfo();
  }
  return item;
}
 
開發者ID:vaclav,項目名稱:voicemenu,代碼行數:20,代碼來源:Activity_TransformationMenu.java

示例7: setPbrScene

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
/**
 * Set the scene to put a light probe.
 *
 * @param scene the scene to put a light probe.
 */
public void setPbrScene(@Nullable final Node scene) {

    final Node prevScene = getPbrScene();

    if (prevScene != null) {
        prevScene.removeLight(lightProbe);
    }

    this.pbrScene = scene;

    if (scene != null) {
        scene.addLight(lightProbe);
    }

    this.frame = 0;
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder-extension,代碼行數:22,代碼來源:StaticLightProbeSceneAppState.java

示例8: select

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@NotNull
	@Override
	public ResultSet select(
			@NotNull @NonNls String tableName,
			@Nullable @NonNls String columnName,
			@Nullable Pair... where) {
		StringBuilder deepDarkFantasy = new StringBuilder(getQueryString(tableName, columnName));
		if (where != null) {
			deepDarkFantasy
					.append(" WHERE ")
					.append(String.join(" AND ", (CharSequence[]) Pair.convert(where)));
		}
		return querySQL(deepDarkFantasy.toString());
/*
return statement.executeQuery("SELECT " +
		(columnName != null ? columnName : "*") +
		" FROM " + tableName +
		" WHERE " + String.join(" and ", Pair.convert(where))
		);
// NOTICE: HERE I IGNORED THE CASE THAT WHERE IS NULL
*/
	}
 
開發者ID:ProgramLeague,項目名稱:strictfp-back-end,代碼行數:23,代碼來源:MySqlAdapter.java

示例9: createItem

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Nullable
protected TransformationMenuItem createItem(TransformationMenuContext context) {
  Event_TransformationMenu.TMP_SubMenu_8shh52_a6.TMP_Action_8shh52_a0g.Item item = new Event_TransformationMenu.TMP_SubMenu_8shh52_a6.TMP_Action_8shh52_a0g.Item(context);
  String description;
  try {
    description = "single item: " + item.getLabelText("");
  } catch (Throwable t) {
    Logger.getLogger(getClass()).error("Exception while executing getText of the item " + item, t);
    return null;
  }
  context.getEditorMenuTrace().pushTraceInfo();
  try {
    context.getEditorMenuTrace().setDescriptor(new EditorMenuDescriptorBase(description, new SNodePointer("r:7c1e5bbb-2d18-4cf3-a11d-502be6b13261(jetbrains.mps.samples.VoiceMenu.editor)", "6198827212362263672")));
    item.setTraceInfo(context.getEditorMenuTrace().getTraceInfo());
  } finally {
    context.getEditorMenuTrace().popTraceInfo();
  }
  return item;
}
 
開發者ID:vaclav,項目名稱:voicemenu,代碼行數:20,代碼來源:Event_TransformationMenu.java

示例10: invokeSpecial0

import org.jetbrains.annotations.Nullable; //導入依賴的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) ((Double) GeefWaarde_idXSBwowcV5H(node));
    default:
      throw new BHMethodNotFoundException(this, method);
  }
}
 
開發者ID:diederikd,項目名稱:DeBrug,代碼行數:14,代碼來源:ReeelGetalWaarde__BehaviorDescriptor.java

示例11: isAvailable

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, @Nullable PsiElement element) {
    if (!super.isAvailable(project, editor, element)) {
        return false;
    }
    
    element = CsvIntentionHelper.getParentFieldElement(element);
    return element instanceof CsvField &&
            element.getFirstChild() != null &&
            (CsvIntentionHelper.getElementType(element.getFirstChild()) != CsvTypes.QUOTE ||
                    CsvIntentionHelper.getElementType(element.getLastChild()) != CsvTypes.QUOTE);
}
 
開發者ID:SeeSharpSoft,項目名稱:intellij-csv-validator,代碼行數:13,代碼來源:CsvQuoteValueIntentionAction.java

示例12: open

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Contract("_, null -> false")
public static boolean open(Player player, @Nullable ItemStack bpItem) {
    if (ItemUtils.isEmpty(bpItem)) {
        return false;
    }

    BackpackType type;
    String bpId = ItemUtils.getTag(bpItem, ItemUtils.BACKPACK_TAG);
    if (bpId == null || (type = BackpackManager.getBackpackType(bpId)) == null) {
        return false;
    }

    Backpack backpack;
    String bpUid = ItemUtils.getTag(bpItem, ItemUtils.BACKPACK_UID_TAG);
    UUID uuid = bpUid == null ? null : UUID.fromString(bpUid);
    if (!BACKPACKS.containsKey(uuid)) {
        if (uuid == null) {
            backpack = type.createBackpack();
            ItemUtils.setTag(
                    bpItem, ItemUtils.BACKPACK_UID_TAG, backpack.getUniqueId().toString());
        } else {
            backpack = type.createBackpack(uuid);
        }

        BACKPACKS.put(backpack.getUniqueId(), backpack);
    } else {
        backpack = BACKPACKS.get(uuid);
    }

    backpack.open(player);
    return true;
}
 
開發者ID:EndlessCodeGroup,項目名稱:RPGInventory,代碼行數:33,代碼來源:BackpackManager.java

示例13: resolveNumber

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Override
public @Nullable Number resolveNumber(LamiTableEntry entry) {
    LamiData data = entry.getValue(fColIndex);
    if (data instanceof LamiIRQ) {
        return (((LamiIRQ) data).getNumber());
    }

    return null;
}
 
開發者ID:lttng,項目名稱:lttng-scope,代碼行數:10,代碼來源:LamiIRQNumberAspect.java

示例14: FileAction

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
public FileAction(@Nullable final ResourceElement element, @Nullable final Array<ResourceElement> elements) {
    this.element = element;
    this.elements = elements;
    setText(getName());
    setOnAction(this::execute);

    final Image icon = getIcon();
    if (icon != null) setGraphic(new ImageView(icon));
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:10,代碼來源:FileAction.java

示例15: findCommand

import org.jetbrains.annotations.Nullable; //導入依賴的package包/類
@Nullable
private static Command findCommand(@NotNull String name)
{
    Command[] commands = Ioc.context().findAll(Command.class);
    for (Command command : commands)
    {
        if (command.alias().contains(name))
        {
            return command;
        }
    }
    return null;
}
 
開發者ID:miche-atucha,項目名稱:devenv,代碼行數:14,代碼來源:Main.java


注:本文中的org.jetbrains.annotations.Nullable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。