Java Utililty Methods Set to String

List of utility methods to do Set to String

Description

The list of methods to do Set to String are organized into topic(s).

Method

StringtoString(Set attribute)
Returns first value from a set (used to find values of one-valued attributes)
Iterator<String> it = attribute.iterator();
if (it.hasNext()) {
    return it.next();
return null;
String[]toStringArray(final Set set)
Return a Set as a String array
final String[] f = new String[set.size()];
int i = 0;
for (final Iterator<?> iter = set.iterator(); iter.hasNext(); i++) {
    f[i] = iter.next().toString();
return f;
SettoStringSet(String... metrics)
to String Set
return new LinkedHashSet<String>(Arrays.asList(metrics));