@@ -100,38 +100,38 @@ public ParameterVariant(final String name, final String stringValue) {
100100 this .value .setType (ParameterType .PARAMETER_STRING .getValue ());
101101 }
102102
103- public ParameterVariant (final String name , final Byte [] byteArrayValue ) {
103+ public ParameterVariant (final String name , final byte [] byteArrayValue ) {
104104 this .name = name ;
105105 this .value = new rcl_interfaces .msg .ParameterValue ();
106- this .value .setByteArrayValue (Arrays . asList ( byteArrayValue ) );
106+ this .value .setByteArrayValue (byteArrayValue );
107107 this .value .setType (ParameterType .PARAMETER_BYTE_ARRAY .getValue ());
108108 }
109109
110- public ParameterVariant (final String name , final Boolean [] boolArrayValue ) {
110+ public ParameterVariant (final String name , final boolean [] boolArrayValue ) {
111111 this .name = name ;
112112 this .value = new rcl_interfaces .msg .ParameterValue ();
113- this .value .setBoolArrayValue (Arrays . asList ( boolArrayValue ) );
113+ this .value .setBoolArrayValue (boolArrayValue );
114114 this .value .setType (ParameterType .PARAMETER_BOOL_ARRAY .getValue ());
115115 }
116116
117- public ParameterVariant (final String name , final Long [] integerArrayValue ) {
117+ public ParameterVariant (final String name , final long [] integerArrayValue ) {
118118 this .name = name ;
119119 this .value = new rcl_interfaces .msg .ParameterValue ();
120- this .value .setIntegerArrayValue (Arrays . asList ( integerArrayValue ) );
120+ this .value .setIntegerArrayValue (integerArrayValue );
121121 this .value .setType (ParameterType .PARAMETER_INTEGER_ARRAY .getValue ());
122122 }
123123
124- public ParameterVariant (final String name , final Double [] doubleArrayValue ) {
124+ public ParameterVariant (final String name , final double [] doubleArrayValue ) {
125125 this .name = name ;
126126 this .value = new rcl_interfaces .msg .ParameterValue ();
127- this .value .setDoubleArrayValue (Arrays . asList ( doubleArrayValue ) );
127+ this .value .setDoubleArrayValue (doubleArrayValue );
128128 this .value .setType (ParameterType .PARAMETER_DOUBLE_ARRAY .getValue ());
129129 }
130130
131131 public ParameterVariant (final String name , final String [] stringArrayValue ) {
132132 this .name = name ;
133133 this .value = new rcl_interfaces .msg .ParameterValue ();
134- this .value .setStringArrayValue (Arrays . asList ( stringArrayValue ) );
134+ this .value .setStringArrayValue (stringArrayValue );
135135 this .value .setType (ParameterType .PARAMETER_STRING_ARRAY .getValue ());
136136 }
137137
@@ -203,39 +203,39 @@ public final boolean asBool() {
203203 return this .value .getBoolValue ();
204204 }
205205
206- public final Byte [] asByteArray () {
206+ public final byte [] asByteArray () {
207207 if (getType () != ParameterType .PARAMETER_BYTE_ARRAY ) {
208208 throw new IllegalArgumentException ("Invalid type" );
209209 }
210- return this .value .getByteArrayValue (). toArray ( new Byte [ 0 ]) ;
210+ return this .value .getByteArrayValue ();
211211 }
212212
213- public final Boolean [] asBooleanArray () {
213+ public final boolean [] asBooleanArray () {
214214 if (getType () != ParameterType .PARAMETER_BOOL_ARRAY ) {
215215 throw new IllegalArgumentException ("Invalid type" );
216216 }
217- return this .value .getBoolArrayValue (). toArray ( new Boolean [ 0 ]) ;
217+ return this .value .getBoolArrayValue ();
218218 }
219219
220- public final Long [] asIntegerArray () {
220+ public final long [] asIntegerArray () {
221221 if (getType () != ParameterType .PARAMETER_INTEGER_ARRAY ) {
222222 throw new IllegalArgumentException ("Invalid type" );
223223 }
224- return this .value .getIntegerArrayValue (). toArray ( new Long [ 0 ]) ;
224+ return this .value .getIntegerArrayValue ();
225225 }
226226
227- public final Double [] asDoubleArray () {
227+ public final double [] asDoubleArray () {
228228 if (getType () != ParameterType .PARAMETER_DOUBLE_ARRAY ) {
229229 throw new IllegalArgumentException ("Invalid type" );
230230 }
231- return this .value .getDoubleArrayValue (). toArray ( new Double [ 0 ]) ;
231+ return this .value .getDoubleArrayValue ();
232232 }
233233
234234 public final String [] asStringArray () {
235235 if (getType () != ParameterType .PARAMETER_STRING_ARRAY ) {
236236 throw new IllegalArgumentException ("Invalid type" );
237237 }
238- return this .value .getStringArrayValue (). toArray ( new String [ 0 ]) ;
238+ return this .value .getStringArrayValue ();
239239 }
240240
241241 public final rcl_interfaces .msg .Parameter toParameter () {
@@ -256,15 +256,15 @@ public static ParameterVariant fromParameter(final rcl_interfaces.msg.Parameter
256256 case rcl_interfaces .msg .ParameterType .PARAMETER_STRING :
257257 return new ParameterVariant (parameter .getName (), parameter .getValue ().getStringValue ());
258258 case rcl_interfaces .msg .ParameterType .PARAMETER_BYTE_ARRAY :
259- return new ParameterVariant (parameter .getName (), parameter .getValue ().getByteArrayValue (). toArray ( new Byte [ 0 ]) );
259+ return new ParameterVariant (parameter .getName (), parameter .getValue ().getByteArrayValue ());
260260 case rcl_interfaces .msg .ParameterType .PARAMETER_BOOL_ARRAY :
261- return new ParameterVariant (parameter .getName (), parameter .getValue ().getBoolArrayValue (). toArray ( new Boolean [ 0 ]) );
261+ return new ParameterVariant (parameter .getName (), parameter .getValue ().getBoolArrayValue ());
262262 case rcl_interfaces .msg .ParameterType .PARAMETER_INTEGER_ARRAY :
263- return new ParameterVariant (parameter .getName (), parameter .getValue ().getIntegerArrayValue (). toArray ( new Long [ 0 ]) );
263+ return new ParameterVariant (parameter .getName (), parameter .getValue ().getIntegerArrayValue ());
264264 case rcl_interfaces .msg .ParameterType .PARAMETER_DOUBLE_ARRAY :
265- return new ParameterVariant (parameter .getName (), parameter .getValue ().getDoubleArrayValue (). toArray ( new Double [ 0 ]) );
265+ return new ParameterVariant (parameter .getName (), parameter .getValue ().getDoubleArrayValue ());
266266 case rcl_interfaces .msg .ParameterType .PARAMETER_STRING_ARRAY :
267- return new ParameterVariant (parameter .getName (), parameter .getValue ().getStringArrayValue (). toArray ( new String [ 0 ]) );
267+ return new ParameterVariant (parameter .getName (), parameter .getValue ().getStringArrayValue ());
268268 case rcl_interfaces .msg .ParameterType .PARAMETER_NOT_SET :
269269 throw new IllegalArgumentException ("Type from ParameterValue is not set" );
270270 default :
0 commit comments