Class ImmutableNonupletonList<T>

    • Field Detail

      • element1

        private final T element1
      • element2

        private final T element2
      • element3

        private final T element3
      • element4

        private final T element4
      • element5

        private final T element5
      • element6

        private final T element6
      • element7

        private final T element7
      • element8

        private final T element8
      • element9

        private final T element9
    • Constructor Detail

      • ImmutableNonupletonList

        ImmutableNonupletonList​(T obj1,
                                T obj2,
                                T obj3,
                                T obj4,
                                T obj5,
                                T obj6,
                                T obj7,
                                T obj8,
                                T obj9)
    • Method Detail

      • size

        public int size()
        Description copied from interface: RichIterable
        Returns the number of items in this iterable.
        Specified by:
        size in interface java.util.Collection<T>
        Specified by:
        size in interface java.util.List<T>
        Specified by:
        size in interface RichIterable<T>
      • each

        public void each​(Procedure<? super T> procedure)
        Description copied from interface: RichIterable
        The procedure is executed for each element in the iterable.

        Example using a Java 8 lambda expression:

         people.each(person -> LOGGER.info(person.getName()));
         

        Example using an anonymous inner class:

         people.each(new Procedure<Person>()
         {
             public void value(Person person)
             {
                 LOGGER.info(person.getName());
             }
         });
         
        This method is a variant of InternalIterable.forEach(Procedure) that has a signature conflict with Iterable.forEach(java.util.function.Consumer).
        Specified by:
        each in interface RichIterable<T>
        See Also:
        InternalIterable.forEach(Procedure), Iterable.forEach(java.util.function.Consumer)
      • get

        public T get​(int index)
        Description copied from interface: ListIterable
        Returns the item at the specified position in this list iterable.
        Specified by:
        get in interface java.util.List<T>
        Specified by:
        get in interface ListIterable<T>
      • getOnly

        public T getOnly()
        Description copied from interface: RichIterable
        Returns the element if the iterable has exactly one element. Otherwise, throw IllegalStateException.
        Specified by:
        getOnly in interface RichIterable<T>
        Returns:
        an element of an iterable.