@Test
 public void shouldConvertToVector() {
   final Value<Integer> value = of(1, 2, 3);
   final Vector<Integer> vector = value.toVector();
   if (value.isSingleValued()) {
     assertThat(vector).isEqualTo(Vector.of(1));
   } else {
     assertThat(vector).isEqualTo(Vector.of(1, 2, 3));
   }
 }
Beispiel #2
0
 @Override
 protected Vector<Byte> ofAll(byte[] array) {
   return Vector.ofAll(array);
 }
Beispiel #3
0
 @Override
 protected Vector<Boolean> ofAll(boolean[] array) {
   return Vector.ofAll(array);
 }
Beispiel #4
0
 @Override
 protected Vector<Integer> range(int from, int toExclusive) {
   return Vector.range(from, toExclusive);
 }
Beispiel #5
0
 @Override
 protected Vector<Character> range(char from, char toExclusive) {
   return Vector.range(from, toExclusive);
 }
Beispiel #6
0
 @Override
 protected <T> Vector<T> tabulate(int n, Function<? super Integer, ? extends T> f) {
   return Vector.tabulate(n, f);
 }
Beispiel #7
0
 @Override
 protected Vector<Long> ofAll(long[] array) {
   return Vector.ofAll(array);
 }
Beispiel #8
0
 @Override
 protected Vector<Float> ofAll(float[] array) {
   return Vector.ofAll(array);
 }
Beispiel #9
0
 @Override
 protected Vector<Long> rangeClosedBy(long from, long toInclusive, long step) {
   return Vector.rangeClosedBy(from, toInclusive, step);
 }
Beispiel #10
0
 @Override
 protected Vector<Long> rangeClosed(long from, long toInclusive) {
   return Vector.rangeClosed(from, toInclusive);
 }
Beispiel #11
0
 @Override
 protected Vector<Integer> rangeClosedBy(int from, int toInclusive, int step) {
   return Vector.rangeClosedBy(from, toInclusive, step);
 }
Beispiel #12
0
 @Override
 protected Vector<Integer> rangeClosed(int from, int toInclusive) {
   return Vector.rangeClosed(from, toInclusive);
 }
Beispiel #13
0
 @Override
 protected Vector<Double> rangeClosedBy(double from, double toInclusive, double step) {
   return Vector.rangeClosedBy(from, toInclusive, step);
 }
Beispiel #14
0
 @Override
 protected Vector<Character> rangeClosed(char from, char toInclusive) {
   return Vector.rangeClosed(from, toInclusive);
 }
Beispiel #15
0
 @Override
 protected Vector<Long> range(long from, long toExclusive) {
   return Vector.range(from, toExclusive);
 }
Beispiel #16
0
 @Override
 protected Vector<Character> ofAll(char[] array) {
   return Vector.ofAll(array);
 }
Beispiel #17
0
 @Override
 protected Vector<Double> ofAll(double[] array) {
   return Vector.ofAll(array);
 }
Beispiel #18
0
 @Override
 protected <T> Collector<T, ArrayList<T>, Vector<T>> collector() {
   return Vector.collector();
 }
Beispiel #19
0
 @Override
 protected Vector<Integer> ofAll(int[] array) {
   return Vector.ofAll(array);
 }
Beispiel #20
0
 @Override
 protected <T> Vector<T> empty() {
   return Vector.empty();
 }
Beispiel #21
0
 @Override
 protected Vector<Short> ofAll(short[] array) {
   return Vector.ofAll(array);
 }
Beispiel #22
0
 @Override
 protected <T> Vector<T> of(T element) {
   return Vector.of(element);
 }
Beispiel #23
0
 @Override
 protected <T> Vector<T> fill(int n, Supplier<? extends T> s) {
   return Vector.fill(n, s);
 }
Beispiel #24
0
 @SuppressWarnings("varargs")
 @SafeVarargs
 @Override
 protected final <T> Vector<T> of(T... elements) {
   return Vector.of(elements);
 }
Beispiel #25
0
 @Override
 protected Vector<Character> rangeBy(char from, char toExclusive, int step) {
   return Vector.rangeBy(from, toExclusive, step);
 }
Beispiel #26
0
 @Override
 protected <T> Vector<T> ofAll(Iterable<? extends T> elements) {
   return Vector.ofAll(elements);
 }