/** * Turn this {@code Tuple} into a {@link List List<Object>}. * The list isn't tied to this Tuple but is a <strong>copy</strong> with limited * mutability ({@code add} and {@code remove} are not supported, but {@code set} is). * * @return A copy of the tuple as a new {@link List List<Object>}. */ public List<Object> toList() { return Arrays.asList(toArray()); }
/** * A Tuple String representation is the comma separated list of values, enclosed * in square brackets. * @return the Tuple String representation */ @Override public final String toString() { return Tuples.tupleStringRepresentation(toArray()).insert(0, '[').append(']').toString(); } }
@Test public void getAllValuesCorrespondToArray() { Object[] array = full.toArray(); for (int i = 0; i < array.length; i++) { assertThat(full.get(i)).as("element " + i).isEqualTo(array[i]); } }
/** * Turn this {@code Tuple} into a {@link List List<Object>}. * The list isn't tied to this Tuple but is a <strong>copy</strong> with limited * mutability ({@code add} and {@code remove} are not supported, but {@code set} is). * * @return A copy of the tuple as a new {@link List List<Object>}. */ public List<Object> toList() { return Arrays.asList(toArray()); }
/** * A Tuple String representation is the comma separated list of values, enclosed * in square brackets. * @return the Tuple String representation */ @Override public final String toString() { return Tuples.tupleStringRepresentation(toArray()).insert(0, '[').append(']').toString(); } }