Class JList

  • All Implemented Interfaces:

    
    public class JList
    
                        

    Provides helpers for creating a List easily in place. Java 9 has these features under 'List', but I scoped them under 'JList' ('J' for 'Jitsi') to avoid conflicts with java.util.List Note that these helpers are in Java 9 and this should be removed once we migrate to Java 9.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      JList()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static <E> List<E> of(Array<E> elements) Some notes from https://docs.oracle.com/javase/9/docs/api/java/util/List.html: The List.of() static factory methods provide a convenient way to create immutable lists.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JList

        JList()
    • Method Detail

      • of

        @SafeVarargs() static <E> List<E> of(Array<E> elements)

        Some notes from https://docs.oracle.com/javase/9/docs/api/java/util/List.html: The List.of() static factory methods provide a convenient way to create immutable lists. The List instances created by these methods have the following characteristics: They are structurally immutable. Elements cannot be added, removed, or replaced. Calling any mutator method will always cause UnsupportedOperationException to be thrown. However, if the contained elements are themselves mutable, this may cause the List's contents to appear to change. They disallow null elements. Attempts to create them with null elements result in NullPointerException. They are serializable if all elements are serializable. The order of elements in the list is the same as the order of the provided arguments, or of the elements in the provided array. They are value-based. Callers should make no assumptions about the identity of the returned instances. Factories are free to create new instances or reuse existing ones. Therefore, identity-sensitive operations on these instances (reference equality (==), identity hash code, and synchronization) are unreliable and should be avoided. They are serialized as specified on the Serialized Form page. Note(brian): the implementation here differs from the one in the Java 9 lib, but I've tried to enforce the characteristics above.

        Parameters:
        elements - the elements to add to the list
        Returns:

        an immutable list containing the given elements