Returns the tags in TSDB query string format.

@param   tags  The tags to convert. Can be null.

@return  The formatted tags.

@throws  UnsupportedEncodingException  If UTF-8 is not supported.
348983
protected String toTagParameterArray(Map<String, String> tags) throws UnsupportedEncodingException {
    	if(tags == null || tags.isEmpty()) {
    		return "";
    	}
    	
        StringBuilder sb = new StringBuilder(encode("{", "UTF-8"));
        for (Map.Entry<String, String> tagEntry : tags.entrySet()) {
            sb.append(tagEntry.getKey()).append("=");

            String tagV = tagEntry.getValue().replaceAll("\\|", encode("|", "UTF-8"));

            sb.append(tagV).append(",");
        }
        sb.replace(sb.length() - 1, sb.length(), encode("}", "UTF-8"));
        
        return sb.toString();
    }
142752
public String getTags() {
        Set<String> setOfTags = getTagsAsSet();

        if (setOfTags.isEmpty()) {
            return "";
        }

        StringBuilder buf = new StringBuilder();
        for (String tag : setOfTags) {
            buf.append(tag);
            buf.append(",");
        }

        String tagsAsString = buf.toString();
        return tagsAsString.substring(0, tagsAsString.length()-1);
    }
801720
public java.util.List<java.util.Map<String, String>> getTags() {
        return tags;
    }
1158386
public CreateChannelRequest withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
965942
public EntityFilter withTags(java.util.Collection<java.util.Map<String, String>> tags) {
        setTags(tags);
        return this;
    }
313215
private static void decodeTag(String stringTag, Map<TagKey, TagValueWithMetadata> tags) {
    String keyWithValue;
    int firstPropertyIndex = stringTag.indexOf(TAG_PROPERTIES_DELIMITER);
    if (firstPropertyIndex != -1) { // Tag with properties.
      keyWithValue = stringTag.substring(0, firstPropertyIndex);
      // TODO(songya): support decoding tag properties.
    } else { // Tag without properties.
      keyWithValue = stringTag;
    }
    List<String> keyValuePair = TAG_KEY_VALUE_SPLITTER.splitToList(keyWithValue);
    checkArgument(keyValuePair.size() == 2, "Malformed tag " + stringTag);
    TagKey key = TagKey.create(keyValuePair.get(0).trim());
    TagValue value = TagValue.create(keyValuePair.get(1).trim());
    TagValueWithMetadata valueWithMetadata =
        TagValueWithMetadata.create(value, METADATA_UNLIMITED_PROPAGATION);
    tags.put(key, valueWithMetadata);
  }
117232
public DescribeFleetResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
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());
  }
110995
public GetLoggerDefinitionResult 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;
    }
1104784
@Override
	public List<String> getAllTags () throws DatabaseException {
    	SqlPreparedStatementWrapper psGetAllTags = null;
        try {
        	psGetAllTags = DbSQL.getSingleton().getPreparedStatement("tag.ps.getalltags");
			List<String> result = new ArrayList<>();
			try (ResultSet rs = psGetAllTags.getPs().executeQuery()) {
				while (rs.next()) {
					result.add(rs.getString(TAG));
				}
			}
			
			return result;
		} catch (SQLException e) {
			throw new DatabaseException(e);
		} finally {
			DbSQL.getSingleton().releasePreparedStatement(psGetAllTags);
		}
    }
548043
public String[] tags(TagSet tagSet)
    {
        assert tagArray != null;

        String[] tags = new String[tagArray.length];
        for (int i = 0; i < tags.length; i++)
        {
            tags[i] = tagSet.stringOf(tagArray[i]);
        }

        return tags;
    }
961866
public Input withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
619605
public static Map<String, String> tags(String ... strings) {
        Map<String, String> tags = new HashMap<>();
        for (int i = 0; i < strings.length - 1; i+=2) {
            String key = strings[i];
            String value = strings[i + 1];
            if (key != null && value != null) {
                tags.put(key, value);
            }
        }
        return tags;
    }
734731
public GetConnectorDefinitionResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }
44740
public static List<String> tagsFromCSV(String tags) {
        ArrayList<String> list = new ArrayList<String>();
        for (String tag: tags.split(",")) {
            list.add(tag);
        }
        return list;
    }
209495
public CreateRobotApplicationResult withTags(java.util.Map<String, String> tags) {
        setTags(tags);
        return this;
    }