@@ -100,38 +100,38 @@ public ParameterVariant(final String name, final String stringValue) {
100
100
this .value .setType (ParameterType .PARAMETER_STRING .getValue ());
101
101
}
102
102
103
- public ParameterVariant (final String name , final Byte [] byteArrayValue ) {
103
+ public ParameterVariant (final String name , final byte [] byteArrayValue ) {
104
104
this .name = name ;
105
105
this .value = new rcl_interfaces .msg .ParameterValue ();
106
- this .value .setByteArrayValue (Arrays . asList ( byteArrayValue ) );
106
+ this .value .setByteArrayValue (byteArrayValue );
107
107
this .value .setType (ParameterType .PARAMETER_BYTE_ARRAY .getValue ());
108
108
}
109
109
110
- public ParameterVariant (final String name , final Boolean [] boolArrayValue ) {
110
+ public ParameterVariant (final String name , final boolean [] boolArrayValue ) {
111
111
this .name = name ;
112
112
this .value = new rcl_interfaces .msg .ParameterValue ();
113
- this .value .setBoolArrayValue (Arrays . asList ( boolArrayValue ) );
113
+ this .value .setBoolArrayValue (boolArrayValue );
114
114
this .value .setType (ParameterType .PARAMETER_BOOL_ARRAY .getValue ());
115
115
}
116
116
117
- public ParameterVariant (final String name , final Long [] integerArrayValue ) {
117
+ public ParameterVariant (final String name , final long [] integerArrayValue ) {
118
118
this .name = name ;
119
119
this .value = new rcl_interfaces .msg .ParameterValue ();
120
- this .value .setIntegerArrayValue (Arrays . asList ( integerArrayValue ) );
120
+ this .value .setIntegerArrayValue (integerArrayValue );
121
121
this .value .setType (ParameterType .PARAMETER_INTEGER_ARRAY .getValue ());
122
122
}
123
123
124
- public ParameterVariant (final String name , final Double [] doubleArrayValue ) {
124
+ public ParameterVariant (final String name , final double [] doubleArrayValue ) {
125
125
this .name = name ;
126
126
this .value = new rcl_interfaces .msg .ParameterValue ();
127
- this .value .setDoubleArrayValue (Arrays . asList ( doubleArrayValue ) );
127
+ this .value .setDoubleArrayValue (doubleArrayValue );
128
128
this .value .setType (ParameterType .PARAMETER_DOUBLE_ARRAY .getValue ());
129
129
}
130
130
131
131
public ParameterVariant (final String name , final String [] stringArrayValue ) {
132
132
this .name = name ;
133
133
this .value = new rcl_interfaces .msg .ParameterValue ();
134
- this .value .setStringArrayValue (Arrays . asList ( stringArrayValue ) );
134
+ this .value .setStringArrayValue (stringArrayValue );
135
135
this .value .setType (ParameterType .PARAMETER_STRING_ARRAY .getValue ());
136
136
}
137
137
@@ -203,39 +203,39 @@ public final boolean asBool() {
203
203
return this .value .getBoolValue ();
204
204
}
205
205
206
- public final Byte [] asByteArray () {
206
+ public final byte [] asByteArray () {
207
207
if (getType () != ParameterType .PARAMETER_BYTE_ARRAY ) {
208
208
throw new IllegalArgumentException ("Invalid type" );
209
209
}
210
- return this .value .getByteArrayValue (). toArray ( new Byte [ 0 ]) ;
210
+ return this .value .getByteArrayValue ();
211
211
}
212
212
213
- public final Boolean [] asBooleanArray () {
213
+ public final boolean [] asBooleanArray () {
214
214
if (getType () != ParameterType .PARAMETER_BOOL_ARRAY ) {
215
215
throw new IllegalArgumentException ("Invalid type" );
216
216
}
217
- return this .value .getBoolArrayValue (). toArray ( new Boolean [ 0 ]) ;
217
+ return this .value .getBoolArrayValue ();
218
218
}
219
219
220
- public final Long [] asIntegerArray () {
220
+ public final long [] asIntegerArray () {
221
221
if (getType () != ParameterType .PARAMETER_INTEGER_ARRAY ) {
222
222
throw new IllegalArgumentException ("Invalid type" );
223
223
}
224
- return this .value .getIntegerArrayValue (). toArray ( new Long [ 0 ]) ;
224
+ return this .value .getIntegerArrayValue ();
225
225
}
226
226
227
- public final Double [] asDoubleArray () {
227
+ public final double [] asDoubleArray () {
228
228
if (getType () != ParameterType .PARAMETER_DOUBLE_ARRAY ) {
229
229
throw new IllegalArgumentException ("Invalid type" );
230
230
}
231
- return this .value .getDoubleArrayValue (). toArray ( new Double [ 0 ]) ;
231
+ return this .value .getDoubleArrayValue ();
232
232
}
233
233
234
234
public final String [] asStringArray () {
235
235
if (getType () != ParameterType .PARAMETER_STRING_ARRAY ) {
236
236
throw new IllegalArgumentException ("Invalid type" );
237
237
}
238
- return this .value .getStringArrayValue (). toArray ( new String [ 0 ]) ;
238
+ return this .value .getStringArrayValue ();
239
239
}
240
240
241
241
public final rcl_interfaces .msg .Parameter toParameter () {
@@ -256,15 +256,15 @@ public static ParameterVariant fromParameter(final rcl_interfaces.msg.Parameter
256
256
case rcl_interfaces .msg .ParameterType .PARAMETER_STRING :
257
257
return new ParameterVariant (parameter .getName (), parameter .getValue ().getStringValue ());
258
258
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 ());
260
260
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 ());
262
262
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 ());
264
264
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 ());
266
266
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 ());
268
268
case rcl_interfaces .msg .ParameterType .PARAMETER_NOT_SET :
269
269
throw new IllegalArgumentException ("Type from ParameterValue is not set" );
270
270
default :
0 commit comments