Converts array of values.
@param value
@return
435472
protected Object[] columnValues(Object[] value) {
        Object[] res = new Object[value.length];
        for (int i = 0; i < value.length; i++) {
            res[i] = columnValue(value[i]);
        }
        return res;
    }
1070394
protected Object[] cast(Object[] values) {
        Object[] res = new Object[values.length];
        for (int i = 0; i < res.length; i++) {
            res[i] = cast(values[i]);
        }
        return res;
    }
413577
public R toBoolArray(@Nullable Iterable<Boolean> values) {
    return handle(Value.boolArray(values));
  }
1069326
function (value) {

            if (!Array.isArray(value)) {

                // null/undefined or anything else must be safely convert to string

                value = value + '';
            }

            if (Array.isArray(value)) {

                // map all values again
                value = value.map(v => this.parseValue(v));

            } else if (validator.isNumeric(value)) {

                value = value * 1; // parse as a number

            } else if (validator.isBoolean(value)) {

                value = (value === 'true');

            } else {

                // convert to JS date
                const date = validator.toDate(value);

                // date is valid, assign
                if (date !== null) {

                    value = date;
                }

                if (value === 'null') {

                    value = null;
                }

                if (value === 'undefined') {

                    value = undefined;
                }
            }

            return value;
        }
217533
public static function toArray($value)
    {
        # If it's already an array then just pass it back
        if (is_array($value)) {
            return $value;
        }

        if ($value instanceof SerialObject) {
            return $value->asArray();
        }

        if ($value instanceof \ArrayObject) {
            return $value->getArrayCopy();
        }

        # If it's not an array then create a new array to be returned
        $array = [];

        # If a value was passed as a string/int then include it in the new array
        if ($value) {
            $array[] = $value;
        }

        return $array;
    }
1159182
public static int[] unWrap(Integer... values) {
		if (null == values) {
			return null;
		}
		final int length = values.length;
		if (0 == length) {
			return new int[0];
		}

		final int[] array = new int[length];
		for (int i = 0; i < length; i++) {
			array[i] = values[i].intValue();
		}
		return array;
	}
581673
private List<String> createListFromValue(String value) {

        if (value == null) {
            return null;
        }
        List<String> result = CmsStringUtil.splitAsList(value, VALUE_LIST_DELIMITER);
        if (value.indexOf(VALUE_LIST_DELIMITER_REPLACEMENT) != -1) {
            List<String> tempList = new ArrayList<String>(result.size());
            Iterator<String> i = result.iterator();
            while (i.hasNext()) {
                String item = i.next();
                tempList.add(rebuildDelimiter(item, VALUE_LIST_DELIMITER, VALUE_LIST_DELIMITER_REPLACEMENT));
            }
            result = tempList;
        }

        return result;
    }
149648
private BigDecimal convertValue(final Object value) {
		if (value == null) {
			return null;
		} else if (value instanceof BigDecimal) {
			return (BigDecimal) value;
		}

		// Try and convert "String" value
		String dataString = value.toString();
		if (Util.empty(dataString)) {
			return null;
		}

		try {
			return new BigDecimal(dataString);
		} catch (NumberFormatException ex) {
			throw new SystemException(
					"Could not convert data of type " + value.getClass() + " with String value "
					+ dataString + " to BigDecimal", ex);
		}
	}
1185414
public static void fillArray(Object[] array, Object value) {

        int to = array.length;

        while (--to >= 0) {
            array[to] = value;
        }
    }
518219
public static JSONArray getArray(JSONValue value) {
        if (value == null)
            return null;
        if (!(value instanceof JSONArray))
            throw new JSONException(NOT_AN_ARRAY);
        return (JSONArray)value;
    }
1145782
private function prepareValue($value)
    {
        if (is_array($value)) {
            foreach ($value as &$val) {
                if (is_array($val) and count($val) === 1) {
                    $val = array_shift($val);
                }
            }
            unset($val);

            if (count($value) === 1) {
                $value = array_shift($value);
            }
        }

        return $value;
    }
492221
function (value, array) {
            if (util.isFn(array.indexOf)) {
                return array.indexOf(value);
            } else {
                return $.inArray(value, array);
            }
        }
151342
public static Object getPrimitiveValueArray(Object value)
   {
      if (value == null)
         return null;

      Class<?> javaType = value.getClass();
      if (javaType.isArray())
      {
         int length = Array.getLength(value);
         Object destArr = Array.newInstance(getPrimitiveType(javaType.getComponentType()), length);
         for (int i = 0; i < length; i++)
         {
            Object srcObj = Array.get(value, i);
            Array.set(destArr, i, getPrimitiveValueArray(srcObj));
         }
         return destArr;
      }

      return value;
   }
1323297
protected Collection<?> convertInternal(Object value) {
		final Collection<Object> collection = CollectionUtil.create(TypeUtil.getClass(this.collectionType));
		return CollUtil.addAll(collection, value, this.elementType);
	}
1081345
@Override
    public byte[] convertTo(final Object value) {
        if (value == null) {
            final BsonWriter out = writerPool.get().tiny(tiny);
            out.writeNull();
            byte[] result = out.toArray();
            writerPool.accept(out);
            return result;
        }
        return convertTo(value.getClass(), value);
    }
1334540
public static String[] split(String value) {
        if (value == null || "".equals(value)) {
            return EMPTY_STRING_ARRAY;
        }
        int len = value.length();
        List<String> list = new LinkedList<>();
        boolean collectingSpace = true;
        int start = 0;
        for (int i = 0; i < len; i++) {
            char c = value.charAt(i);
            if (c == ' ' || c == '\t' || c == '\n' || c == '\r') {
                if (!collectingSpace) {
                    list.add(value.substring(start, i));
                    collectingSpace = true;
                }
            } else {
                if (collectingSpace) {
                    start = i;
                    collectingSpace = false;
                }
            }
        }
        if (start < len) {
            int end = len;
            for (int i = 1; len > i; i++) {
                char c = value.charAt(len - i);
                if (c == ' ' || c == '\t' || c == '\n' || c == '\r') {
                    end--;
                    continue;
                }
                break;
            }
            list.add(value.substring(start, end));
        }
        return list.toArray(EMPTY_STRING_ARRAY);
    }
1020049
public PactDslJsonArray stringValue(String value) {
      if (value == null) {
        body.put(JSONObject.NULL);
      } else {
        body.put(value);
      }
      return this;
    }