List of utility methods to do List First Item
T | firstUnique(List first Unique List<T> temp = new ArrayList<>(list); for (int i = 0; i < temp.size(); i++) { T elem = temp.get(i); temp.remove(elem); if (!temp.contains(elem)) { return elem; return null; |
T | firstValue(List Returns the first value of a list, or null if the list is empty. if (list != null && !list.isEmpty()) { return list.get(0); return null; |
String | formatEJBQLObjectRangeRestriction(final String fieldName, final Object value1, final Object value2, final String paramName1, final String paramName2, List format EJBQL Object Range Restriction String result = ""; if (value1 != null && value1.equals(value2)) { result = String.format("(%s = :%s)", fieldName, paramName1); paramsName.add(paramName1); paramsValue.add(value1); } else if (value1 != null || value2 != null) { if (value1 == null) { result = String.format("(%s <= :%s)", fieldName, paramName2); ... |
String | formatEJBQLObjectRestriction(final String fieldName, final Object value, final String paramName, List format EJBQL Object Restriction String result = ""; if (value != null) { result = String.format("(%s = :%s)", fieldName, paramName); paramsName.add(paramName); paramsValue.add(value); result = generateRestrictionPrefix(result, firstRestriction); return result; ... |
List | getAllButFirst(List get All But First Iterator<T> iterator = list.iterator(); iterator.next(); LinkedList<T> result = new LinkedList<T>(); addAll(result, iterator); return result; |
String | getDependenciesPrivate(List get Dependencies Private if (projects.isEmpty()) { return ""; StringBuilder builder = new StringBuilder(); if (!firstDependencies) { builder.append(","); builder.append(getCompileTargetName(projects.get(0))); ... |
T | getFirst(List get First if (c == null || c.size() == 0) return null; return c.get(0); |
T | getFirst(List Return the first item of l if it isn't empty, otherwise null .
return getNoExn(l, 0);
|
T | getFirst(List get First if (isEmpty(list)) { return null; return list.get(0); |
T | getFirst(List Returns the first element in a list, or null if there is none. return list == null || list.isEmpty() ? null : list.get(0);
|