Java List First Item listWith(Object aFirstObject)

Here you can find the source of listWith(Object aFirstObject)

Description

list With

License

Open Source License

Declaration

public static List listWith(Object aFirstObject) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static List listWith(Object aFirstObject) {
        List list = new ArrayList();
        list.add(aFirstObject);/*ww  w.j  a v  a 2  s .c o  m*/
        return list;
    }

    public static List listWith(Object aFirstObject, Object aSecondObject) {
        List list = listWith(aFirstObject);
        list.add(aSecondObject);
        return list;
    }

    public static List listWith(Object aFirstObject, Object aSecondObject, Object aThirdObject) {
        List list = listWith(aFirstObject, aSecondObject);
        list.add(aThirdObject);
        return list;
    }

    public static List listWith(Object aFirstObject, Object aSecondObject, Object aThirdObject,
            Object aFourthObject) {
        List list = listWith(aFirstObject, aSecondObject, aThirdObject);
        list.add(aFourthObject);
        return list;
    }

    public static List listWith(Object aFirstObject, Object aSecondObject, Object aThirdObject,
            Object aFourthObject, Object aFifthObject) {
        List list = listWith(aFirstObject, aSecondObject, aThirdObject, aFourthObject);
        list.add(aFifthObject);
        return list;
    }

    public static List listWith(Object aFirstObject, Object aSecondObject, Object aThirdObject,
            Object aFourthObject, Object aFifthObject, Object aSixthObject) {
        List list = listWith(aFirstObject, aSecondObject, aThirdObject, aFourthObject, aFifthObject);
        list.add(aSixthObject);
        return list;
    }
}

Related

  1. isFirst(List list, V object)
  2. isFirstAnnotationOfMethod(List lines, int lineNumber)
  3. isFirstPage(List pageLines, List> rawPages)
  4. isInOrder(List src, Object first, Object second)
  5. limit(List list, Long firstResult, Long maxResults)
  6. merge(List first, List second)
  7. mergeLists(List first, List second)
  8. mergeLists(List first, List second)
  9. mergePreserveOrder(List first, List second)