com.evolveum.midpoint.prism.Item.find()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(77)

本文整理了Java中com.evolveum.midpoint.prism.Item.find()方法的一些代码示例,展示了Item.find()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.find()方法的具体详情如下:
包路径:com.evolveum.midpoint.prism.Item
类名称:Item
方法名:find

Item.find介绍

[英]Returns object (Item or PrismValue) pointed to by the given path.
[中]返回给定路径指向的对象(项或PrismValue)。

代码示例

代码示例来源:origin: Evolveum/midpoint

private Object getRealContent(Item<?,?> item, ItemPath residualPath) {
  if (residualPath == null || residualPath.isEmpty()) {
    return item;
  }
  if (item == null) {
    return null;
  }
  return item.find(residualPath);
}

代码示例来源:origin: Evolveum/midpoint

private static Collection<PrismEntityPair<?>> createExistingPairs(Collection existing, Item item) {
  Collection<PrismEntityPair<?>> pairs = new ArrayList<>();
  for (Object obj : existing) {
    if (obj instanceof Container) {
      Container container = (Container) obj;
      PrismValue value = (PrismValue) item.find(ItemPath.create(container.getId()));
      pairs.add(new PrismEntityPair(value, container));
    } else {
      // todo improve somehow
      pairs.add(new PrismEntityPair(null, obj));
    }
  }
  return pairs;
}

代码示例来源:origin: Evolveum/midpoint

@Override
public Object find(ItemPath path) {
  if (path == null || path.isEmpty()) {
    return this;
  }
  Object first = path.first();
  if (!ItemPath.isName(first)) {
    throw new IllegalArgumentException("Attempt to lookup item using a non-name path "+path+" in "+this);
  }
  ItemName subName = ItemPath.toName(first);
  ItemPath rest = path.rest();
  Item<?,?> subItem = findItem(subName);
  if (subItem == null) {
    return null;
  }
  return subItem.find(rest);
}

相关文章