protected static @NotNull String convertValueToGroovySource(@NotNull Object value){
  if (value instanceof List) {
    StringBuilder sb=new StringBuilder();
    sb.append('[');
    for (    Object v : ((List)value)) {
      if (sb.length() > 1) {
        sb.append(", ");
      }
      sb.append(convertValueToGroovySource(v));
    }
    sb.append(']');
    return sb.toString();
  }
 else   if (value instanceof Number || value instanceof Boolean) {
    return value.toString();
  }
 else {
    return "'" + escapeLiteralString(value.toString()) + "'";
  }
}

protected static @ NotNull String convertValueToGroovySource ( @ NotNull Object value ) { if ( value instanceof List ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( '[' ) ; for ( Object v : ( ( List ) value ) ) { if ( sb . length ( ) > 1 ) { sb . append ( ", " ) ; } sb . append ( convertValueToGroovySource ( v ) ) ; } sb . append ( ']' ) ; return sb . toString ( ) ; } else if ( value instanceof Number || value instanceof Boolean ) { return value . toString ( ) ; } else { return "'" + escapeLiteralString ( value . toString ( ) ) + "'" ; } }
returns a text string with the groovy expression that will represent the given object . it can be a literal type or a list of literals or sub - lists .
