本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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
*/
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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));
}
示例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;
}