Here you can find the source of castToStringArray(Object[] array)
Parameter | Description |
---|---|
array | a parameter |
public static String[] castToStringArray(Object[] array)
//package com.java2s; /*//from w ww . j a v a 2s . c o m Pulsar Copyright (C) 2013-2015 eBay Software Foundation Licensed under the GPL v2 license. See LICENSE for full terms. */ public class Main { /** * EPL has embedded cast method, but it doesn't cover arrays * * @param array * @return */ public static String[] castToStringArray(Object[] array) { if (array != null) { String[] retArray = new String[array.length]; int i = 0; for (Object element : array) { retArray[i] = element == null ? null : element.toString(); i++; } return retArray; } return null; } }