public static void setObjectArrayField()

in src/org/doublecloud/ws/util/ReflectUtil.java [153:188]


  public static void setObjectArrayField(Object object, Field field, String type, List<String> values) throws IllegalArgumentException, IllegalAccessException 
  {
    if("String[]".equals(type) || "string[]".equals(type))
    {
      String[] vals = new String[values.size()];
      field.set(object, values.toArray(vals));
    }
    else if("int[]".equals(type))
    {
      field.set(object, toIntArray(values));
    }
    else if("short[]".equals(type))
    {
      field.set(object, toShortArray(values));
    }
    else if("byte[]".equals(type))
    {
      field.set(object, toByteArray(values));
    }
    else if("long[]".equals(type))
    {
      field.set(object, toLongArray(values));
    }
    else if("float[]".equals(type))
    {
      field.set(object, toFloatArray(values));
    }
    else if("boolean[]".equals(type))
    {
      field.set(object, toBooleanArray(values));
    }
    else
    {
      throw new RuntimeException("Unexpected Type at setObjectArrayField: " + field.getType().getCanonicalName() + field.getName());
    }
  }