com.amazonaws.services.s3.model.Region.values()方法的使用及代码示例

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

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

Region.values介绍

暂无

代码示例

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

/**
 * Returns the Amazon S3 Region enumeration value representing the specified Amazon
 * S3 Region ID string. If specified string doesn't map to a known Amazon S3
 * Region, then an <code>IllegalArgumentException</code> is thrown.
 *
 * @param s3RegionId
 *            The Amazon S3 region ID string.
 *
 * @return The Amazon S3 Region enumeration value representing the specified Amazon
 *         S3 Region ID.
 *
 * @throws IllegalArgumentException
 *             If the specified value does not map to one of the known
 *             Amazon S3 regions.
 */
public static Region fromValue(final String s3RegionId) throws IllegalArgumentException
{
  if (s3RegionId == null || s3RegionId.equals("US") || s3RegionId.equals("us-east-1")) {
    return Region.US_Standard;
  }
  for (Region region : Region.values()) {
    List<String> regionIds = region.regionIds;
    if (regionIds != null && regionIds.contains(s3RegionId))
      return region;
  }
  throw new IllegalArgumentException(
      "Cannot create enum from " + s3RegionId + " value!");
}

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

/**
 * Returns the Amazon S3 Region enumeration value representing the specified
 * Amazon S3 Region ID string. If specified string doesn't map to a known
 * Amazon S3 Region, then an <code>IllegalArgumentException</code> is
 * thrown.
 *
 * @param s3RegionId The Amazon S3 region ID string.
 * @return The Amazon S3 Region enumeration value representing the specified
 *         Amazon S3 Region ID.
 * @throws IllegalArgumentException If the specified value does not map to
 *             one of the known Amazon S3 regions.
 */
public static Region fromValue(final String s3RegionId) throws IllegalArgumentException
{
  if (s3RegionId == null || s3RegionId.equals("US") || s3RegionId.equals("us-east-1")) {
    return Region.US_Standard;
  }
  for (final Region region : Region.values()) {
    final List<String> regionIds = region.regionIds;
    if (regionIds != null && regionIds.contains(s3RegionId)) {
      return region;
    }
  }
  throw new IllegalArgumentException(
      "Cannot create enum from " + s3RegionId + " value!");
}

代码示例来源:origin: takipi/aws-s3-speed

private void init()
  {
    for (Region region : Region.values())
    {
      List<Long> list = new ArrayList<Long>();
      this.uploadTimings.put(region, list);
      this.downloadTimings.put(region, list);
    }
    
    S3Manager.initBuckets(false);
  }
}

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

/**
 * Returns the Amazon S3 Region enumeration value representing the specified
 * Amazon S3 Region ID string. If specified string doesn't map to a known
 * Amazon S3 Region, then an <code>IllegalArgumentException</code> is
 * thrown.
 *
 * @param s3RegionId The Amazon S3 region ID string.
 * @return The Amazon S3 Region enumeration value representing the specified
 *         Amazon S3 Region ID.
 * @throws IllegalArgumentException If the specified value does not map to
 *             one of the known Amazon S3 regions.
 */
public static Region fromValue(final String s3RegionId) throws IllegalArgumentException
{
  if (s3RegionId == null || s3RegionId.equals("US") || s3RegionId.equals("us-east-1")) {
    return Region.US_Standard;
  }
  for (final Region region : Region.values()) {
    final List<String> regionIds = region.regionIds;
    if (regionIds != null && regionIds.contains(s3RegionId)) {
      return region;
    }
  }
  throw new IllegalArgumentException(
      "Cannot create enum from " + s3RegionId + " value!");
}

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

/**
 * Returns the Amazon S3 Region enumeration value representing the specified Amazon
 * S3 Region ID string. If specified string doesn't map to a known Amazon S3
 * Region, then an <code>IllegalArgumentException</code> is thrown.
 *
 * @param s3RegionId
 *            The Amazon S3 region ID string.
 *
 * @return The Amazon S3 Region enumeration value representing the specified Amazon
 *         S3 Region ID.
 *
 * @throws IllegalArgumentException
 *             If the specified value does not map to one of the known
 *             Amazon S3 regions.
 */
public static Region fromValue(final String s3RegionId) throws IllegalArgumentException
{
  if (s3RegionId == null || s3RegionId.equals("US") || s3RegionId.equals("us-east-1")) {
    return Region.US_Standard;
  }
  for (Region region : Region.values()) {
    List<String> regionIds = region.regionIds;
    if (regionIds != null && regionIds.contains(s3RegionId))
      return region;
  }
  throw new IllegalArgumentException(
      "Cannot create enum from " + s3RegionId + " value!");
}

代码示例来源:origin: takipi/aws-s3-speed

for (Region region : Region.values())

代码示例来源:origin: takipi/aws-s3-speed

public static void initBuckets(boolean create)
  for (Region region : Region.values())

相关文章