Class Arrays

java.lang.Object
org.opencastproject.util.data.Arrays

public final class Arrays extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <A> A[]
    append(Class<A> type, A[] as, A a)
    Create a new array by appending a to as: [as0, as1, .. asn, a].
    static <A> A[]
    array(A... as)
    Create an array from the vararg parameter list.
    static <A> A[]
    cons(Class<A> type, A a, A[] as)
    Create a new array by prepending a to as: [a, as0, as1, .. asn]
    static <A> String
    mkString(A[] as, String sep)
    Make a string from a collection separating each element by sep.
    static <A> Function<A,A[]>
    singleton(Class<A> type)
    Turn a value into a single element array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • cons

      public static <A> A[] cons(Class<A> type, A a, A[] as)
      Create a new array by prepending a to as: [a, as0, as1, .. asn]
    • append

      public static <A> A[] append(Class<A> type, A[] as, A a)
      Create a new array by appending a to as: [as0, as1, .. asn, a].
    • array

      public static <A> A[] array(A... as)
      Create an array from the vararg parameter list.
    • singleton

      public static <A> Function<A,A[]> singleton(Class<A> type)
      Turn a value into a single element array.
    • mkString

      public static <A> String mkString(A[] as, String sep)
      Make a string from a collection separating each element by sep.