Return a new {@code Tags} instance by merging this collection and the specified tags.

@param tags the tags to add
@return a new {@code Tags} instance
508255
public Tags and(@Nullable Tag... tags) {
        if (tags == null || tags.length == 0) {
            return this;
        }
        Tag[] newTags = new Tag[last + tags.length];
        System.arraycopy(this.tags, 0, newTags, 0, last);
        System.arraycopy(tags, 0, newTags, last, tags.length);
        return new Tags(newTags);
    }
1282862
public CreateInputRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
668502
public Tags merge(Tags other) {
    // Dereference "other" first as a null pointer check so we cannot risk returning null later.
    if (other.isEmpty()) {
      return this;
    }
    if (this.isEmpty()) {
      return other;
    }
    SortedMap<String, SortedSet<Object>> merged = new TreeMap<String, SortedSet<Object>>();
    for (Map.Entry<String, SortedSet<Object>> e : map.entrySet()) {
      SortedSet<Object> otherValues = other.map.get(e.getKey());
      if (otherValues == null || e.getValue().containsAll(otherValues)) {
        // Our values are a superset of the values in the other map, so just use them.
        merged.put(e.getKey(), e.getValue());
      } else if (otherValues.containsAll(e.getValue())) {
        // The other map's values are a superset of ours, so just use them.
        merged.put(e.getKey(), otherValues);
      } else {
        // Values exist in both maps and neither is a superset, so we really must merge.
        SortedSet<Object> mergedValues = new TreeSet<Object>(e.getValue());
        mergedValues.addAll(otherValues);
        merged.put(e.getKey(), Collections.unmodifiableSortedSet(mergedValues));
      }
    }
    for (Map.Entry<String, SortedSet<Object>> e : other.map.entrySet()) {
      // Finally add those values that were only in the other map.
      if (!map.containsKey(e.getKey())) {
        merged.put(e.getKey(), e.getValue());
      }
    }
    return new Tags(Collections.unmodifiableSortedMap(merged));
  }
117232
public DescribeFleetResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1056872
public CreateAppRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
1158386
public CreateChannelRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
166499
public CreateSimulationJobResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
306625
public PurchaseOfferingRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
968892
public ApplicationResponse withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
90869
public CreateBrokerRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
999245
public CreateConfigurationRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
74892
public CreateInputSecurityGroupRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
877658
public DescribeConfigurationResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
580591
public App withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
251448
public static BasicTagList copyOf(Map<String, String> tags) {
    SmallTagMap.Builder builder = SmallTagMap.builder();
    for (Map.Entry<String, String> tag : tags.entrySet()) {
      builder.add(Tags.newTag(tag.getKey(), tag.getValue()));
    }
    return new BasicTagList(builder.result());
  }
1214862
public static BasicTagList of(String... tags) {
    Preconditions.checkArgument(tags.length % 2 == 0,
        "tags must be a sequence of key,value pairs");

    final SmallTagMap.Builder builder = SmallTagMap.builder();
    for (int i = 0; i < tags.length; i += 2) {
      Tag t = Tags.newTag(tags[i], tags[i + 1]);
      builder.add(t);
    }
    return new BasicTagList(builder.result());
  }
359418
public ProjectDescription withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }