Commit 733ec13b authored by Daniel Le Berre's avatar Daniel Le Berre

Add Java 9 style of factory methods to vectors.

parent 3cdc6688
Pipeline #4578 failed with stages
in 13 minutes and 44 seconds
......@@ -544,4 +544,17 @@ public final class Vec<T> implements IVec<T> {
this.copyTo(cloned);
return cloned;
}
/**
* Alternative way to create a vector, the Java 9+ way.
*
* @param values
* an arbitrary number of values
* @return a new vector with those values
* @since 2.3.6
*/
@SafeVarargs
public static <U> Vec<U> of(U... values) {
return new Vec<>(values);
}
}
......@@ -655,4 +655,16 @@ public final class VecInt implements IVecInt {
this.copyTo(cloned);
return cloned;
}
/**
* Alternative way to create a vector, the Java 9+ way.
*
* @param values
* an arbitrary number of values
* @return a new vector with those values
* @since 2.3.6
*/
public static VecInt of(int... values) {
return new VecInt(values);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment