code: public static String getLabel(Object value) {
          if (value != null) {
              if (value instanceof CompositeObject) {
                  CompositeObject descriptor = (CompositeObject) value;
                  String label = getLanguageLabel(descriptor);
                  return label != null ? label : descriptor.toString();
              } else if (value.getClass().isArray()) {
                  Object[] objects = (Object[]) value;
                  return getLabel(Arrays.asList(objects));
              } else if (value instanceof Iterable) {
                  StringBuilder sb = new StringBuilder();
                  for (Object o : ((Iterable) value)) {
                      if (sb.length() > 0) {
                          sb.append(",");
                      }
                      sb.append(getLabel(o));
                  }
                  return "[" + sb.toString() + "]";
              } else if (value instanceof Map) {
                  StringBuilder sb = new StringBuilder();
                  for (Map.Entry<String, Object> entry : ((Map<String, Object>) value).entrySet()) {
                      if (sb.length() > 0) {
                          sb.append(",");
                      }
                      sb.append(entry.getKey());
                      sb.append(":");
                      sb.append(getLabel(entry.getValue()));
                  }
                  return "{" + sb.toString() + "}";
              }
              return value.toString();
          }
          return null;
      }
docs: Converts a value to its string representation.
  
  @param value
  The value.
  @return The string representation