本文整理了Java中org.eclipse.ditto.json.JsonPointer.get()
方法的一些代码示例,展示了JsonPointer.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonPointer.get()
方法的具体详情如下:
包路径:org.eclipse.ditto.json.JsonPointer
类名称:JsonPointer
方法名:get
[英]Returns the JSON key at the specified level within this JSON pointer.
[中]返回此JSON指针内指定级别的JSON键。
代码示例来源:origin: org.eclipse.ditto/ditto-protocol-adapter
@Override
public Optional<JsonKey> get(final int level) {
return jsonPointer.get(level);
}
代码示例来源:origin: org.eclipse.ditto/ditto-protocol-adapter
@Override
public Optional<MessageDirection> getDirection() {
return jsonPointer.getRoot()
.flatMap(ImmutableMessagePath::jsonKeyToDirection)
.map(Optional::of)
.orElseGet(() -> jsonPointer.getRoot()
.filter(FEATURES::equals)
.flatMap(features -> jsonPointer.get(2))
.flatMap(ImmutableMessagePath::jsonKeyToDirection));
}
代码示例来源:origin: eclipse/ditto
private boolean isOnReferencePointer(final JsonPointer evaluationPointer) {
boolean result = true;
final int referencePointerLevelCount = referencePointer.getLevelCount();
final int evaluationPointerLevelCount = evaluationPointer.getLevelCount();
int currentLevel = 0;
while (result &&
currentLevel < referencePointerLevelCount &&
currentLevel < evaluationPointerLevelCount) {
final JsonKey referencePointerCurrentLevelKey = referencePointer.get(currentLevel).orElse(null);
result = evaluationPointer.get(currentLevel)
.filter(k -> k.equals(referencePointerCurrentLevelKey))
.isPresent();
currentLevel++;
}
return result;
}
代码示例来源:origin: eclipse/ditto
@Override
public Optional<MessageDirection> getDirection() {
return jsonPointer.getRoot()
.flatMap(ImmutableMessagePath::jsonKeyToDirection)
.map(Optional::of)
.orElseGet(() -> jsonPointer.getRoot()
.filter(FEATURES::equals)
.flatMap(features -> jsonPointer.get(2))
.flatMap(ImmutableMessagePath::jsonKeyToDirection));
}
代码示例来源:origin: eclipse/ditto
@Override
public Optional<JsonKey> get(final int level) {
return jsonPointer.get(level);
}
代码示例来源:origin: eclipse/ditto
protected static String featureIdFrom(final Adaptable adaptable) {
final JsonPointer path = adaptable.getPayload().getPath();
return path.get(1).orElseThrow(() -> UnknownPathException.newBuilder(path).build()).toString();
}
代码示例来源:origin: org.eclipse.ditto/ditto-protocol-adapter
protected static String featureIdFrom(final Adaptable adaptable) {
final JsonPointer path = adaptable.getPayload().getPath();
return path.get(1).orElseThrow(() -> UnknownPathException.newBuilder(path).build()).toString();
}
代码示例来源:origin: eclipse/ditto
grantedResources, revokedResources, level, true);
} else {
resource.get(level).ifPresent(jsonKey -> policyTreeNode.getChild(jsonKey.toString())
.ifPresent(child -> traverseSubtreeForPermissionAccess(permission, resource, type, child,
grantedResources, revokedResources, level + 1, true)));
final Optional<JsonKey> jsonKeyOptional = resource.get(level);
if (followingResource && jsonKeyOptional.isPresent()) {
policyTreeNode.getChild(jsonKeyOptional.get().toString())
内容来源于网络,如有侵权,请联系作者删除!