org.jclouds.openstack.v2_0.services.Extension.namespace()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(137)

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

Extension.namespace介绍

暂无

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public Optional<Object> apply(InvocationSuccess input) {
 Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
 Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
    .getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
 if (ext.isPresent()) {
   URI namespace = URI.create(ext.get().namespace());
   List<Object> args = input.getInvocation().getArgs();
   if (args.isEmpty()) {
    if (any(extensions.getUnchecked(""), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
      return input.getResult();
   } else if (args.size() == 1) {
    String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
    if (any(extensions.getUnchecked(arg0), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
      return input.getResult();
   } else {
    throw new RuntimeException(String.format("expecting zero or one args %s", input));
   }
   return Optional.absent();
 } else {
   // No extension annotation, should check whether to return absent
   return input.getResult();
 }
}

代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-keystone

@Override
public Optional<Object> apply(InvocationSuccess input) {
 Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
 Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
    .getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
 if (ext.isPresent()) {
   URI namespace = URI.create(ext.get().namespace());
   List<Object> args = input.getInvocation().getArgs();
   if (args.isEmpty()) {
    if (any(extensions.getUnchecked(""), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
      return input.getResult();
   } else if (args.size() == 1) {
    String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
    if (any(extensions.getUnchecked(arg0), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
      return input.getResult();
   } else {
    throw new RuntimeException(String.format("expecting zero or one args %s", input));
   }
   return Optional.absent();
 } else {
   // No extension annotation, should check whether to return absent
   return input.getResult();
 }
}

代码示例来源:origin: org.jclouds.api/openstack-keystone

@Override
public Optional<Object> apply(InvocationSuccess input) {
 Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
 Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
    .getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
 if (ext.isPresent()) {
   URI namespace = URI.create(ext.get().namespace());
   List<Object> args = input.getInvocation().getArgs();
   if (args.isEmpty()) {
    if (any(extensions.getUnchecked(""), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
      return input.getResult();
   } else if (args.size() == 1) {
    String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
    if (any(extensions.getUnchecked(arg0), namespaceOrAliasEquals(namespace, aliases.get(namespace))))
      return input.getResult();
   } else {
    throw new RuntimeException(String.format("expecting zero or one args %s", input));
   }
   return Optional.absent();
 } else {
   // No extension annotation, should check whether to return absent
   return input.getResult();
 }
}

代码示例来源:origin: Nextdoor/bender

@Override
public Optional<Object> apply(InvocationSuccess input) {
 Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
 Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
    .getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
 if (ext.isPresent()) {
   URI namespace = URI.create(ext.get().namespace());
   List<Object> args = input.getInvocation().getArgs();
   Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
   String name = ext.get().name();
   String alias = ext.get().alias();
   if (args.isEmpty()) {
    if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else if (args.size() == 1) {
    String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
    if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else {
    throw new RuntimeException(String.format("expecting zero or one args %s", input));
   }
   return Optional.absent();
 } else {
   // No extension annotation, should check whether to return absent
   return input.getResult();
 }
}

代码示例来源:origin: com.amysta.jclouds.api/openstack-keystone

@Override
public Optional<Object> apply(InvocationSuccess input) {
 Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
 Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
    .getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
 if (ext.isPresent()) {
   URI namespace = URI.create(ext.get().namespace());
   List<Object> args = input.getInvocation().getArgs();
   Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
   String name = ext.get().name();
   String alias = ext.get().alias();
   if (args.isEmpty()) {
    if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else if (args.size() == 1) {
    String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
    if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else {
    throw new RuntimeException(String.format("expecting zero or one args %s", input));
   }
   return Optional.absent();
 } else {
   // No extension annotation, should check whether to return absent
   return input.getResult();
 }
}

代码示例来源:origin: org.apache.jclouds.api/openstack-keystone

@Override
public Optional<Object> apply(InvocationSuccess input) {
 Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
 Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
    .getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
 if (ext.isPresent()) {
   URI namespace = URI.create(ext.get().namespace());
   List<Object> args = input.getInvocation().getArgs();
   Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
   String name = ext.get().name();
   String alias = ext.get().alias();
   if (args.isEmpty()) {
    if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else if (args.size() == 1) {
    String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
    if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else {
    throw new RuntimeException(String.format("expecting zero or one args %s", input));
   }
   return Optional.absent();
 } else {
   // No extension annotation, should check whether to return absent
   return input.getResult();
 }
}

代码示例来源:origin: apache/jclouds

@Override
public Optional<Object> apply(InvocationSuccess input) {
 Class<?> target = unwrapIfOptional(input.getInvocation().getInvokable().getReturnType());
 Optional<org.jclouds.openstack.v2_0.services.Extension> ext = Optional.fromNullable(target
    .getAnnotation(org.jclouds.openstack.v2_0.services.Extension.class));
 if (ext.isPresent()) {
   URI namespace = URI.create(ext.get().namespace());
   List<Object> args = input.getInvocation().getArgs();
   Set<URI> aliasesForNamespace = aliases.containsKey(namespace) ? aliases.get(namespace) : Sets.<URI> newHashSet();
   String name = ext.get().name();
   String alias = ext.get().alias();
   if (args.isEmpty()) {
    if (checkExtension("", namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else if (args.size() == 1) {
    String arg0 = checkNotNull(args.get(0), "arg[0] in %s", input).toString();
    if (checkExtension(arg0, namespace, aliasesForNamespace, alias, name)) {
      return input.getResult();
    }
   } else {
    throw new RuntimeException(String.format("expecting zero or one args %s", input));
   }
   return Optional.absent();
 } else {
   // No extension annotation, should check whether to return absent
   return input.getResult();
 }
}

相关文章