Calls a constructor of this class with the given arguments @param args The arguments to pass to the constructor @return An NMSObject wrapping the returned value
(Object... args)
| 51 | * @return An NMSObject wrapping the returned value |
| 52 | */ |
| 53 | public NMSObject getInstance(Object... args) { |
| 54 | try { |
| 55 | NMSHelper.unwrapArgs(args); |
| 56 | return new NMSObject(NMSHelper.getConstructor(clazz, NMSHelper.getArgTypes(args)).newInstance(args)); |
| 57 | } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { |
| 58 | throw new IllegalArgumentException(e); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Creates an array of this class type |
no test coverage detected