本文整理汇总了Java中com.redhat.lightblue.util.Path.getLast方法的典型用法代码示例。如果您正苦于以下问题:Java Path.getLast方法的具体用法?Java Path.getLast怎么用?Java Path.getLast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.redhat.lightblue.util.Path
的用法示例。
在下文中一共展示了Path.getLast方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: gatherRequiredFields
import com.redhat.lightblue.util.Path; //导入方法依赖的package包/类
/**
* Returns a list of the field names that are needed for the operation to be
* successful.
* @param md - {@link EntityMetadata}.
* @param projection - (optional) {@link Projection}.
* @param query - (optional) {@link QueryExpression}.
* @param sort - (optional) {@link Sort}.
* @return list of field names.
*/
private Set<Path> gatherRequiredFields(EntityMetadata md,
Projection projection, QueryExpression query, Sort sort) {
Set<Path> paths = new HashSet<>();
FieldCursor cursor = md.getFieldCursor();
while (cursor.next()) {
Path node = cursor.getCurrentPath();
String fieldName = node.getLast();
if (((projection != null) && projection.isFieldRequiredToEvaluateProjection(node))
|| ((query != null) && query.isRequired(node))
|| ((sort != null) && sort.isRequired(node))) {
if (PredefinedFields.isFieldAnArrayCount(fieldName, md.getFields())) {
/*
* Handles the case of an array count field, which will not actually exist in
* the ldap entity.
*/
paths.add(node.mutableCopy().setLast(PredefinedFields.createArrayFieldNameFromCountField(fieldName)).immutableCopy());
}
else {
paths.add(node);
}
}
}
return paths;
}
示例2: translateFieldName
import com.redhat.lightblue.util.Path; //导入方法依赖的package包/类
@Override
public String translateFieldName(Path path) {
return path.getLast();
}