gpt4 book ai didi

org.opendaylight.controller.netconf.util.xml.XmlElement.getNamespaceOptionally()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-27 11:51:05 31 4
gpt4 key购买 nike

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

XmlElement.getNamespaceOptionally介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.controller/netconf-util

public Optional<XmlElement> getOnlyChildElementWithSameNamespaceOptionally() {
  Optional<XmlElement> child = getOnlyChildElementOptionally();
  if (child.isPresent()
      && child.get().getNamespaceOptionally().isPresent()
      && getNamespaceOptionally().isPresent()
      && getNamespaceOptionally().get().equals(child.get().getNamespaceOptionally().get())) {
    return child;
  }
  return Optional.absent();
}

代码示例来源:origin: org.opendaylight.controller/netconf-util

public String getNamespace() throws MissingNameSpaceException {
  Optional<String> namespaceURI = getNamespaceOptionally();
  if (!namespaceURI.isPresent()){
    throw new MissingNameSpaceException(String.format("No namespace defined for %s", this),
        NetconfDocumentedException.ErrorType.application,
        NetconfDocumentedException.ErrorTag.operation_failed,
        NetconfDocumentedException.ErrorSeverity.error);
  }
  return namespaceURI.get();
}

代码示例来源:origin: org.opendaylight.controller/netconf-util

public boolean hasNamespace() {
  if (!getNamespaceAttributeOptionally().isPresent()) {
    if (!getNamespaceOptionally().isPresent()) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.opendaylight.controller/netconf-util

public Optional<XmlElement> getOnlyChildElementWithSameNamespaceOptionally(final String childName) {
  Optional<String> namespace = getNamespaceOptionally();
  if (namespace.isPresent()) {
    List<XmlElement> children = getChildElementsWithinNamespace(namespace.get());
    children = Lists.newArrayList(Collections2.filter(children, new Predicate<XmlElement>() {
      @Override
      public boolean apply(XmlElement xmlElement) {
        return xmlElement.getName().equals(childName);
      }
    }));
    if (children.size() != 1){
      return Optional.absent();
    }
    return Optional.of(children.get(0));
  }
  return Optional.absent();
}

代码示例来源:origin: org.opendaylight.controller/netconf-util

Optional<String> namespaceOptionally = getNamespaceOptionally();
if(namespaceOptionally.isPresent()) {
  namespaces.put(DEFAULT_NAMESPACE_PREFIX, namespaceOptionally.get());

代码示例来源:origin: org.opendaylight.controller/netconf-impl

src.getNamespaceOptionally().equals(filter.getNamespaceOptionally());
MatchingResult result = null;
if (tagMatch) {

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com