本文整理汇总了Java中org.eclipse.jdt.annotation.Nullable类的典型用法代码示例。如果您正苦于以下问题:Java Nullable类的具体用法?Java Nullable怎么用?Java Nullable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Nullable类属于org.eclipse.jdt.annotation包,在下文中一共展示了Nullable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: equals
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Override
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof MatchChecker)) {
return false;
}
MatchChecker other = (MatchChecker) obj;
if (this.language != other.language) {
return false;
}
if (!this.qualName.equals(other.qualName)) {
return false;
}
return true;
}
示例2: equals
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Override
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof UnitPar)) {
return false;
}
UnitPar other = (UnitPar) obj;
if (!getDirection().equals(other.getDirection())) {
return false;
}
if (!getType().equals(other.getType())) {
return false;
}
if (!getName().equals(other.getName())) {
return false;
}
return true;
}
示例3: equals
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Override
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof TypeGuard)) {
return false;
}
TypeGuard other = (TypeGuard) obj;
Set<TypeLabel> labelSet = this.labelSet;
if (labelSet == null) {
if (other.labelSet != null) {
return false;
}
} else if (!labelSet.equals(other.labelSet)) {
return false;
}
if (this.negated != other.negated) {
return false;
}
if (!this.var.equals(other.var)) {
return false;
}
return true;
}
示例4: equals
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Setting)) {
return false;
}
Setting<?,?> other = (Setting<?,?>) obj;
@Nullable C content = this.content;
if (content == null) {
if (other.getContent() != null) {
return false;
}
} else if (!content.equals(other.getContent())) {
return false;
}
return this.kind.equals(other.getKind());
}
示例5: equals
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Override
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof FieldExpr)) {
return false;
}
FieldExpr other = (FieldExpr) obj;
if (this.type != other.type) {
return false;
}
String target = this.target;
if (target == null) {
if (other.target != null) {
return false;
}
} else if (!target.equals(other.target)) {
return false;
}
return this.field.equals(other.field);
}
示例6: EnumParser
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
/**
* Constructs an instance with a flag to indicate if the empty string
* should be approved.
* @param enumType the enum type supported by this property
* @param defaultValue the value of {@code T} represented
* by the empty string
*/
public EnumParser(Class<T> enumType, @Nullable T defaultValue, String... texts) {
this.defaultValue = defaultValue;
this.toStringMap = new EnumMap<>(enumType);
this.toValueMap = new HashMap<>();
this.valueType = enumType;
T[] values = enumType.getEnumConstants();
assert values.length == texts.length;
for (int i = 0; i < values.length; i++) {
if (texts[i] != null) {
this.toStringMap.put(values[i], texts[i]);
T oldValue = this.toValueMap.put(texts[i], values[i]);
assert oldValue == null : "Duplicate key " + texts[i];
}
}
this.toValueMap.put("", defaultValue);
this.toValueMap.put(null, defaultValue);
}
示例7: CacheReference
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
/**
* Constructs a new reference, for a given cache and cache holder, on the
* basis of an existing template. All data except the cache are shared from
* the template reference. Presumably the template reference was cleared.
* @param holder the cache holder for the new cache
* @param referent the cache to be held; non-<code>null</code>
* @param template the template reference; not <code>null</code>
*/
protected CacheReference(CacheHolder<C> holder, C referent, CacheReference<C> template) {
super(referent, queue);
this.holder = holder;
this.incarnation = template.incarnation + 1;
incFrequency(this.incarnation);
this.strong = template.strong;
if (this.strong) {
this.referent = referent;
}
this.strongNull = template.strongNull;
this.softNull = template.softNull;
// see if there is any post-clearing up to be done for caches
// that have been collected by the gc
CacheReference<@Nullable ?> reference = (CacheReference<@Nullable ?>) queue.poll();
while (reference != null) {
reference.updateCleared();
cacheCollectCount++;
reference = (CacheReference<@Nullable ?>) queue.poll();
}
if (holder != null) {
createCount++;
}
}
示例8: createImage
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
/**
* Callback method to create an edge image for {@link #mapEdge(Edge)}. This
* implementation creates a @link DefaultEdge} if
* the map contains images for the key's end nodes.
*/
protected @Nullable TE createImage(SE key) {
TN sourceImage = getNode(key.source());
if (sourceImage == null) {
return null;
}
Label labelImage = mapLabel(key.label());
if (labelImage == null) {
return null;
}
TN targetImage = getNode(key.target());
if (targetImage == null) {
return null;
} else {
return getFactory().createEdge(sourceImage, labelImage, targetImage);
}
}
示例9: createNode
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
/**
* Returns a suitable node with a number obtained from a dispenser.
* Typically the node will get the first available number,
* but if node numbers may be unsuitable for some reason then
* the dispenser may be invoked multiple times.
* @throws NoSuchElementException if the dispenser runs out of numbers
*/
public @NonNull N createNode(Dispenser dispenser) {
@Nullable N result = null;
do {
int nr = dispenser.getNext();
result = getNode(nr);
if (result == null) {
// create a new node of the correct type
result = newNode(nr);
registerNode(result);
} else if (!isAllowed(result)) {
// do not use the existing node with this number
result = null;
}
} while (result == null);
return result;
}
示例10: get
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Override
@Nullable
protected String[] get(Event arg0) {
String cmd = commandsk.getSingle(arg0);
String commandStr = cmd.startsWith("/") ? cmd.substring(1) : cmd;
PluginCommand command = Bukkit.getServer().getPluginCommand(commandStr);
if (command != null) {
if (command.getDescription() != null) {
return new String[] {command.getDescription()};
} else {
Skript.error("Command does not have a description!");
return null;
}
}
Skript.error("Command not found!");
return null;
}
示例11: putAttachmentData
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
/**
* Uploads an attachment to the repository
*
* @param task
* attached task
* @param filename
* @param mimeType
* @param description
* @param attachment
* @param monitor
* @throws CharmHttpException
*/
public void putAttachmentData(@NonNull ITask task, String filename, String mimeType, String description,
byte[] attachment, @Nullable IProgressMonitor monitor) throws CharmHttpException {
CharmAttachmentPost charmAttachment = new CharmAttachmentPost();
charmAttachment.setDescription(description);
charmAttachment.setMimeType(mimeType);
charmAttachment.setName(filename);
charmAttachment.setPayload(Base64.getEncoder().encodeToString(attachment));
Response response = buildWebTarget("/task/" + task.getTaskId() + "/attachment", CharmAttachmentPostWriter.class,
CharmErrorMessageBodyReader.class).request(MediaType.APPLICATION_XML)
.post(Entity.entity(charmAttachment, MediaType.APPLICATION_XML));
if (response.getStatus() != 200) {
handleError(response);
}
}
示例12: findApp
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Nullable
public App findApp(int appId) {
switch (appId) {
case 1:
return app1;
case 2:
return app2;
default:
return null;
}
}
示例13: getRepositoryUrlFromTaskUrl
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Override
public @Nullable String getRepositoryUrlFromTaskUrl(@NonNull String taskUrl) {
try {
URL url = new URL(taskUrl);
return url.getHost();
} catch (MalformedURLException e) {
}
return null;
}
示例14: readJsonFromUrl
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Nullable
public static JSONObject readJsonFromUrl(String url) throws IOException, JSONException {
InputStream is = new URL(url).openStream();
try {
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
String jsonText = readAll(rd);
JSONObject json = new JSONObject(jsonText);
return json;
} finally {
is.close();
}
}
示例15: findApp
import org.eclipse.jdt.annotation.Nullable; //导入依赖的package包/类
@Nullable
public App findApp(Integer appId) {
App app = null;
if (appId == null
|| appId <= 0
|| (app = appBiz.findApp(appId)) == null) {
return null;
}
return app;
}