com.amazonaws.regions.Regions.values()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(101)

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

Regions.values介绍

暂无

代码示例

代码示例来源:origin: aws/aws-sdk-java

/**
 * Returns a region enum corresponding to the given region name.
 *
 * @param regionName
 *            The name of the region. Ex.: eu-west-1
 * @return Region enum representing the given region name.
 */
public static Regions fromName(String regionName) {
  for (Regions region : Regions.values()) {
    if (region.getName().equals(regionName)) {
      return region;
    }
  }
  throw new IllegalArgumentException("Cannot create enum from " + regionName + " value!");
}

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

protected static AllowableValue[] getAvailableRegions() {
  final List<AllowableValue> values = new ArrayList<>();
  for (final Regions region : Regions.values()) {
    values.add(createAllowableValue(region));
  }
  return values.toArray(new AllowableValue[values.size()]);
}

代码示例来源:origin: com.amazonaws/aws-java-sdk-core

/**
 * Returns a region enum corresponding to the given region name.
 *
 * @param regionName
 *            The name of the region. Ex.: eu-west-1
 * @return Region enum representing the given region name.
 */
public static Regions fromName(String regionName) {
  for (Regions region : Regions.values()) {
    if (region.getName().equals(regionName)) {
      return region;
    }
  }
  throw new IllegalArgumentException("Cannot create enum from " + regionName + " value!");
}

代码示例来源:origin: aws-amplify/aws-sdk-android

/**
 * Returns a region enum corresponding to the given region name.
 *
 * @param regionName The name of the region. Ex.: eu-west-1
 * @return Region enum representing the given region name.
 */
public static Regions fromName(String regionName) {
  for (final Regions region : Regions.values()) {
    if (regionName.equals(region.getName())) {
      return region;
    }
  }
  throw new IllegalArgumentException("Cannot create enum from " + regionName + " value!");
}

代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures

for (Regions r: Regions.values()){
  if(endpoint.toLowerCase().contains(r.getName().toLowerCase())){
    region = r.getName().toLowerCase();

代码示例来源:origin: com.gluonhq/aws-java-sdk-core

/**
 * Returns a region enum corresponding to the given region name.
 *
 * @param regionName The name of the region. Ex.: eu-west-1
 * @return Region enum representing the given region name.
 */
public static Regions fromName(String regionName) {
  for (final Regions region : Regions.values()) {
    if (regionName.equals(region.getName())) {
      return region;
    }
  }
  throw new IllegalArgumentException("Cannot create enum from " + regionName + " value!");
}

代码示例来源:origin: org.apache.nifi/nifi-aws-abstract-processors

protected static AllowableValue[] getAvailableRegions() {
  final List<AllowableValue> values = new ArrayList<>();
  for (final Regions region : Regions.values()) {
    values.add(createAllowableValue(region));
  }
  return values.toArray(new AllowableValue[values.size()]);
}

代码示例来源:origin: org.apache.hadoop/hadoop-aws

private static String validRegionsString() {
  final String delimiter = ", ";
  Regions[] regions = Regions.values();
  StringBuilder sb = new StringBuilder();
  for (int i = 0; i < regions.length; i++) {
   if (i > 0) {
    sb.append(delimiter);
   }
   sb.append(regions[i].getName());
  }
  return sb.toString();
 }
}

代码示例来源:origin: com.amazonaws/aws-android-sdk-core

/**
 * Returns a region enum corresponding to the given region name.
 *
 * @param regionName The name of the region. Ex.: eu-west-1
 * @return Region enum representing the given region name.
 */
public static Regions fromName(String regionName) {
  for (final Regions region : Regions.values()) {
    if (regionName.equals(region.getName())) {
      return region;
    }
  }
  throw new IllegalArgumentException("Cannot create enum from " + regionName + " value!");
}

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

/**
 * Returns a region enum corresponding to the given region name.
 *
 * @param regionName
 *            The name of the region. Ex.: eu-west-1
 * @return Region enum representing the given region name.
 */
public static Regions fromName(String regionName) {
  for (Regions region : Regions.values()) {
    if (region.getName().equals(regionName)) {
      return region;
    }
  }
  throw new IllegalArgumentException("Cannot create enum from " + regionName + " value!");
}

代码示例来源:origin: jp.xet.spar-wings/spar-wings-aws-essential

@Override
public Region getObject() {
  Regions region = defaultRegion;
  for (Regions r : Regions.values()) {
    if (r.getName().equals(metadata.getRegion())) {
      region = r;
      break;
    }
  }
  
  Region bean = Region.getRegion(region);
  logger.info("loaded {}", bean);
  return bean;
}

代码示例来源:origin: jenkinsci/amazon-ecr-plugin

@Nonnull
  @Override
  public <C extends Credentials> List<C> getCredentials(@Nonnull Class<C> type, @Nullable ItemGroup itemGroup, @Nullable Authentication authentication) {

    if (!type.isAssignableFrom(AmazonECSRegistryCredential.class)) {
      return ImmutableList.of();
    }

    List<C> derived = Lists.newLinkedList();

    final List<AmazonWebServicesCredentials> list = lookupCredentials(AmazonWebServicesCredentials.class, itemGroup, authentication , Collections.EMPTY_LIST);

    for (AmazonWebServicesCredentials credentials : list) {
      LOG.log(Level.FINE, "Resolving Amazon Web Services credentials of scope {0} with id {1} , itemgroup {2}",
          new Object[]{credentials.getScope(), credentials.getId(),itemGroup});
      derived.add((C) new AmazonECSRegistryCredential( credentials.getScope(),
            credentials.getId(),credentials.getDescription(),itemGroup));

      for (Regions region : Regions.values()) {
        LOG.log(Level.FINE, "Resolving Amazon Web Services credentials of scope {0} with id {1} and region {2}",
            new Object[]{credentials.getScope(), credentials.getId(),region});
        derived.add((C) new AmazonECSRegistryCredential( credentials.getScope(),
              credentials.getId(),
              region, credentials.getDescription(),itemGroup));
      }
    }

    return derived;
  }
}

相关文章