com.amazonaws.services.ec2.model.Tag.setKey()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(87)

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

Tag.setKey介绍

[英]The key of the tag.

Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with aws:.
[中]标签的钥匙。
限制:标记键区分大小写,最多可接受127个Unicode字符。不能以[$0$]开头。

代码示例

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

/**
 * Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any
 * additional object members.
 * 
 * @param key
 *        The key of the tag.</p>
 *        <p>
 *        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin
 *        with <code>aws:</code>.
 */
public Tag(String key) {
  setKey(key);
}

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

/**
 * <p>
 * The key of the tag.
 * </p>
 * <p>
 * Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with
 * <code>aws:</code>.
 * </p>
 * 
 * @param key
 *        The key of the tag.</p>
 *        <p>
 *        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin
 *        with <code>aws:</code>.
 * @return Returns a reference to this object so that method calls can be chained together.
 */
public Tag withKey(String key) {
  setKey(key);
  return this;
}

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

/**
 * Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any
 * additional object members.
 * 
 * @param key
 *        The key of the tag.</p>
 *        <p>
 *        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin
 *        with <code>aws:</code>.
 * @param value
 *        The value of the tag.
 *        </p>
 *        <p>
 *        Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
 */
public Tag(String key, String value) {
  setKey(key);
  setValue(value);
}

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

/**
 * Constructs a new Tag object.
 * Callers should use the setter or fluent setter (with...) methods to
 * initialize any additional object members.
 * 
 * @param key The key of the tag. <p>Constraints: Tag keys are
 * case-sensitive and accept a maximum of 127 Unicode characters. May not
 * begin with <code>aws:</code>
 */
public Tag(String key) {
  setKey(key);
}

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

public Tag unmarshall(StaxUnmarshallerContext context) throws Exception {
  Tag tag = new Tag();
  int originalDepth = context.getCurrentDepth();
  int targetDepth = originalDepth + 1;
  if (context.isStartOfDocument())
    targetDepth += 1;
  while (true) {
    XMLEvent xmlEvent = context.nextEvent();
    if (xmlEvent.isEndDocument())
      return tag;
    if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
      if (context.testExpression("key", targetDepth)) {
        tag.setKey(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
      }
      if (context.testExpression("value", targetDepth)) {
        tag.setValue(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
      }
    } else if (xmlEvent.isEndElement()) {
      if (context.getCurrentDepth() < originalDepth) {
        return tag;
      }
    }
  }
}

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

t.setKey( "Name" );
t.setValue( runnerNames );
tags.add( t );

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

t.setKey( "Name" );
t.setValue( instanceNames );
tags.add( t );

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

/**
 * Constructs a new Tag object.
 * Callers should use the setter or fluent setter (with...) methods to
 * initialize any additional object members.
 * 
 * @param key The key of the tag. <p>Constraints: Tag keys are
 * case-sensitive and accept a maximum of 127 Unicode characters. May not
 * begin with <code>aws:</code>
 * @param value The value of the tag. <p>Constraints: Tag values are
 * case-sensitive and accept a maximum of 255 Unicode characters.
 */
public Tag(String key, String value) {
  setKey(key);
  setValue(value);
}

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

/**
 * Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any
 * additional object members.
 * 
 * @param key
 *        The key of the tag.</p>
 *        <p>
 *        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin
 *        with <code>aws:</code>.
 */
public Tag(String key) {
  setKey(key);
}

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

/**
 * <p>
 * The key of the tag.
 * </p>
 * <p>
 * Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with
 * <code>aws:</code>.
 * </p>
 * 
 * @param key
 *        The key of the tag.</p>
 *        <p>
 *        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin
 *        with <code>aws:</code>.
 * @return Returns a reference to this object so that method calls can be chained together.
 */
public Tag withKey(String key) {
  setKey(key);
  return this;
}

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

public Tag unmarshall(StaxUnmarshallerContext context) throws Exception {
  Tag tag = new Tag();
  int originalDepth = context.getCurrentDepth();
  int targetDepth = originalDepth + 1;
  if (context.isStartOfDocument()) targetDepth += 1;
  while (true) {
    int xmlEvent = context.nextEvent();
    if (xmlEvent == XmlPullParser.END_DOCUMENT) return tag;
    if (xmlEvent == XmlPullParser.START_TAG) {
      if (context.testExpression("key", targetDepth)) {
        tag.setKey(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
      }
      if (context.testExpression("value", targetDepth)) {
        tag.setValue(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
      }
    } else if (xmlEvent == XmlPullParser.END_TAG) {
      if (context.getCurrentDepth() < originalDepth) {
        return tag;
      }
    }
  }
}

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

/**
 * Constructs a new Tag object. Callers should use the setter or fluent setter (with...) methods to initialize any
 * additional object members.
 * 
 * @param key
 *        The key of the tag.</p>
 *        <p>
 *        Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin
 *        with <code>aws:</code>.
 * @param value
 *        The value of the tag.
 *        </p>
 *        <p>
 *        Constraints: Tag values are case-sensitive and accept a maximum of 255 Unicode characters.
 */
public Tag(String key, String value) {
  setKey(key);
  setValue(value);
}

代码示例来源:origin: org.kuali.common/kuali-aws

public ImmutableTag(String key, String value) {
  super.setKey(checkNotBlank(key, "key"));
  super.setValue(checkNotBlank(value, "value"));
}

代码示例来源:origin: net.roboconf/roboconf-iaas-ec2

t.setKey("Name");
t.setValue(applicationName + "." + rootInstanceName);
tags.add(t);

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

public Tag unmarshall(StaxUnmarshallerContext context) throws Exception {
  Tag tag = new Tag();
  int originalDepth = context.getCurrentDepth();
  int targetDepth = originalDepth + 1;
  if (context.isStartOfDocument())
    targetDepth += 1;
  while (true) {
    XMLEvent xmlEvent = context.nextEvent();
    if (xmlEvent.isEndDocument())
      return tag;
    if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
      if (context.testExpression("key", targetDepth)) {
        tag.setKey(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
      }
      if (context.testExpression("value", targetDepth)) {
        tag.setValue(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
      }
    } else if (xmlEvent.isEndElement()) {
      if (context.getCurrentDepth() < originalDepth) {
        return tag;
      }
    }
  }
}

相关文章