Convert an Object (which must be an array) to a string to be used as a
description

@param value
The object to be converted
@return The converted string
425283
private String convertSimpleArrayToString(Object value) {
        String answer;
        int length = Array.getLength(value);
        StringBuffer temp = new StringBuffer("{");
        for (int i = 0; i < length && i < MAX_ARRAY_LENGTH; i++) {
            Object element = Array.get(value, i);
            if ((i > 0) && !(element instanceof Character))
                temp.append(",");
            temp.append(element);
        }
        if (length > MAX_ARRAY_LENGTH) {
            if (!(Array.get(value, 0) instanceof Character))
                temp.append(",");
            temp.append("...");
        }
        temp.append("} /* array length = ");
        temp.append(Integer.toString(Array.getLength(value)));
        temp.append(" */");
        answer = temp.toString();
        return answer;
    }
333745
public <T> T convert(Object value, Class<T> clazz) {
    if (null == value) return null;
    if (value instanceof String && Strings.isEmpty((String) value)) { return null; }
    if (value.getClass().isArray()) {
      Object[] values = (Object[]) value;
      if (values.length >= 1) {
        value = values[0];
      }
    }
    return conversion.convert(value, clazz);
  }
956328
function ( value ) {
            var result = Object.prototype.toString.call( value );
            result = result.match( /^\[\W*object\W+([a-zA-Z]+)\W*\]$/ );
    
            if ( result && result.length > 1 ) {
                result = result[1];
            }
    
            if ( result === 'String' ) {
                if ( $B.color.is(value) ) {
                    result = 'Color';
                }
            } else if ( result === 'Number' ) {
                if ( isNaN(value) ) {
                    result = 'NaN';
                }
            } else if ( result === 'Object' ) {
                if ( this.isUndefined(value) ) {
                    result = 'Undefined';
                } else if ( this.isNull(value) ) {
                    result = 'Null';
                } else if ( this.isElement(value) ) {
                    result = 'Element';
                }
            } else {
                if ( this.isElement(value) ) {
                    result = 'Element';
                }
            }
    
            return result;
        }
1001900
function getObjectToStringValue(value) {
            var result = objectToString.call(value);
            switch (result) {
                case '[object Undefined]':
                    return '#Undefined';
                case '[object Null]':
                    return '#Null';
                case '[object Object]':
                    return 'Object';
                case '[object Function]':
                    return 'Function';
                case '[object String]':
                    return 'String';
                case '[object Number]':
                    return (value != +value) ? '#NaN' : 'Number';
                case '[object Array]':
                    return 'Array';
                case '[object Boolean]':
                    return 'Boolean';
                case '[object RegExp]':
                    return 'RegExp';
                case '[object Symbol]':
                    return 'Symbol';
                case '[object Map]':
                    return 'Map';
                case '[object WeakMap]':
                    return 'WeakMap';
                case '[object Set]':
                    return 'Set';
                case '[object WeakSet]':
                    return 'WeakSet';
                case '[object Int8Array]':
                    return 'Int8Array';
                case '[object Uint8Array]':
                    return 'Uint8Array';
                case '[object Uint8ClampedArray]':
                    return 'Uint8ClampedArray';
                case '[object Int16Array]':
                    return 'Int16Array';
                case '[object Uint16Array]':
                    return 'Uint16Array';
                case '[object Int32Array]':
                    return 'Int32Array';
                case '[object Uint32Array]':
                    return 'Uint32Array';
                case '[object Float32Array]':
                    return 'Float32Array';
                case '[object Float64Array]':
                    return 'Float64Array';
                case '[object ArrayBuffer]':
                    return 'ArrayBuffer';
                case '[object DataView]':
                    return 'DataView';
                case '[object Error]':
                    return 'Error';
                case '[object Arguments]':
                    return 'Arguments';
                case '[object JSON]':
                    return 'JSON';
                case '[object Math]':
                    return 'Math';
                case '[object Date]':
                    return 'Date';
                default: //handle the rest (HTML element, future global objects,...)
                    return result.slice(8, -1);
            }
        }
1128373
public static function stringify($value)
    {
        $string = '';
        if (is_scalar($value)) {
            // integer, float, string, boolean
            $string = (string)$value;
        } elseif (is_resource($value)) {
            // resource
            $string = '[resource]';
        } else {
            // array, object, null, callable
            $string = json_encode($value);
        }
        return $string;
    }
1143349
public static function stringify($value)
    {
        if (is_string($value)) {
            return $value;
        }
        if ($value === null || is_bool($value)) {
            return var_export($value, true);
        }

        if (is_array($value) || (is_object($value) && !method_exists($value, '__toString'))) {
            return json_encode($value, JSON_ERROR_NONE | JSON_UNESCAPED_SLASHES);
        }
        return (string)$value;
    }
767569
public static Object convertToJava(Value value) {
        switch (value.getType()) {
            case STRING:
                return ((StringValue) value).get();
            case BOOLEAN:
                return ((BooleanValue) value).get();
            case NUMBER:
                return ((NumberValue) value).get();
            case DATE:
                return ((DateValue) value).get();
            case NIL:
                return null;
            case OBJECT:
                return value.get();
        }
        throw new CommandExecutionException("Could not convert value " + value + " to an equivalent Java object");
    }
758040
protected function convertToArray($value)
    {
        if (\is_string($value)) {
            $value = [$value];
        } elseif (null === $value) {
            $value = [];
        }

        return $value;
    }
964549
@Override
    protected String convertToString(Object value) throws Throwable {
		Key key = (Key) value;
		return KeyFactory.keyToString(key);
    }
195758
public static String serialize(Object value) {
        if (value instanceof String) {
            return (String) value;
        } else if (value instanceof byte[]) {
            return new String((byte[]) value);
        }
1008376
public static function toString($value): string
    {
        if ($value === null) {
            return 'NULL';
        }

        if ($value === true) {
            return 'TRUE';
        }

        if ($value === false) {
            return 'FALSE';
        }

        if (is_object($value)) {
            return static::readObject($value);
        }

        if (is_array($value)) {
            return static::readArray($value);
        }

        if (is_resource($value)) {
            return static::readResource($value);
        }

        return (string) $value;
    }
215266
public static String[] objectArrayToStringArray(final Object[] objectArray) {
		if( objectArray == null ) {
			return null;
		}
		
		final String[] stringArray = new String[objectArray.length];
		for( int i = 0; i < objectArray.length; i++ ) {
			stringArray[i] = objectArray[i] != null ? objectArray[i].toString() : null;
		}
		
		return stringArray;
	}
597563
@Override
    public String handle(Object value) {
        final StringBuilder s = new StringBuilder();
        if (value instanceof BoundingBox) {
            final BoundingBox bbox = (BoundingBox) value;
            s.append(doubleSerializer.handle(bbox.getWest())).append(',');
            s.append(doubleSerializer.handle(bbox.getNorth())).append(',');
            s.append(doubleSerializer.handle(bbox.getEast())).append(',');
            s.append(doubleSerializer.handle(bbox.getSouth()));
        } else {
            s.append(value);
        }
        return s.toString();
    }
606496
public static Range fromString(String value) {
        if (value == null || value.isEmpty())
            return null;
        JsArrayNumber array = JsonUtils.safeEval(value);
        return new Range(array);
    }
471317
private String formatValue(String[] value) {

    String ret = "";
    for(int i=0;i<value.length;i++) {
      ret += value[i];
      if(i<value.length-1) ret+="\n";
    }
    return ret;

  }
1007825
public PactDslJsonArray includesStr(String value) {
    body.put(value);
    matchers.addRule(rootPath + appendArrayIndex(0), includesMatcher(value));
    return this;
  }
534727
public final <T> T decode(Object value) {
      if (value == null) {
         return null;
      }
      if (value instanceof Collection) {
         List<T> list = new ArrayList<>();
         Cast.<Collection<?>>as(value).forEach(o -> list.add(decode(o)));
         return Cast.as(list);
      }
      if (value instanceof Map) {
         Map<String, T> map = new HashMap<>();
         Cast.<Map<?, ?>>as(value).forEach((k, v) -> map.put(k.toString(), decode(v)));
         return Cast.as(map);
      }
      if (value instanceof Val) {
         return decodeImpl(Cast.<Val>as(value).get());
      }
      return decodeImpl(value);
   }