Get distinct select item optional.

@return distinct select items
169288
public Optional<DistinctSelectItem> getDistinctSelectItem() {
        for (SelectItem each : items) {
            if (each instanceof DistinctSelectItem) {
                return Optional.of((DistinctSelectItem) each);
            }
        }
        return Optional.absent();
    }
338625
public static <E> OptionalFunction<Selection<Element>, E> getValue() {
    return OptionalFunction.of(selection -> selection.result().getValue());
  }
1053233
public SimpleListHolder<T> getUniqueFlatUp() {
        if (uniqueUp == null) {
            uniqueUp = newUniqueSimpleListHolder(up_to_root, getSortProperty());
        }
        return uniqueUp;
    }
451333
public static <T> List<T> distinct(final Collection<? extends T> c) {
        if (N.isNullOrEmpty(c)) {
            return new ArrayList<>();
        }

        return distinct(c, 0, c.size());
    }
601010
public T selected()
	{
		return selectedIndex < 0 || selectedIndex >= options().size() ? null : options().get(selectedIndex);
	}
776946
public Optional<QualifiedName> getPrefix()
    {
        if (parts.size() == 1) {
            return Optional.empty();
        }

        List<String> subList = parts.subList(0, parts.size() - 1);
        return Optional.of(new QualifiedName(subList, subList));
    }
531894
private function getSelectQuery()
    {
        return 'SELECT '.(empty($this->parts['select']) ? '*' : implode(', ', $this->parts['select'])).
               ' FROM '.$this->getFromClause().
               (($this->parts['where'] !== null) ? ' WHERE '.$this->parts['where'] : null).
               (!empty($this->parts['group_by']) ? ' GROUP BY '.implode(', ', $this->parts['group_by']) : null).
               (($this->parts['having'] !== null) ? ' HAVING '.$this->parts['having'] : null).
               (!empty($this->parts['order_by']) ? ' ORDER BY '.implode(', ', $this->parts['order_by']) : null).
               (($this->parts['limit'] !== null) ? ' LIMIT '.$this->parts['limit'] : null).
               (($this->parts['offset'] !== null) ? ' OFFSET '.$this->parts['offset'] : null);
    }
352420
protected final function _getItems($select = null)
    {
        if (!$select) $select = $this->_getSelect();
        if (!$select) return array();

        return $this->getData()->parent->getComponent()->getItems($select);
    }
930287
def distinct(self):
        
        new_query_set = self.clone()
        new_query_set.query.distinct = True
        return new_query_set
128748
public String getNullValueSelect()
    {
        String ret = null;
        if (!this.types.isEmpty())  {
            ret = Context.getDbType().getNullValueSelect(this.types.iterator().next());
        }
        return ret;
    }
210747
public SimpleListHolder<T> getUniqueFlatDown() {
        if (uniqueDown == null) {
            uniqueDown = newUniqueSimpleListHolder(down_to_leave, getSortProperty());
        }
        return uniqueDown;
    }
1247012
public MenuItemSelectable getSelectedMenuItem() {
		List<MenuItemSelectable> selectedItems = getSelectedMenuItems();
		if (selectedItems.isEmpty()) {
			return null;
		} else {
			return selectedItems.get(0);
		}
	}
309952
public Collection<ItemT> getSelectedItems() {
        if (availableItems == null || selectedIndices == null || selectedIndices.length == 0) {
            return new ArrayList<ItemT>(0);
        }

        ArrayList<ItemT> items = new ArrayList<ItemT>(selectedIndices.length);
        for (int index : selectedIndices) {
            items.add(availableItems.get(index));
        }
        return items;
    }
798414
public java.util.List<FieldInfo> getSelectFields() {
        if (selectFields == null) {
            selectFields = new com.amazonaws.internal.SdkInternalList<FieldInfo>();
        }
        return selectFields;
    }
899680
public static <T> Iterable<T> distinct(final Iterable<T> iterable) {
        requireNonNull(iterable);
        return () -> Iterators2.distinct(iterable.iterator());
    }
643975
public static <T> Optional<T[]> getOptional(T[] array) {
        return Optional.ofNullable(array).filter(a -> a.length > 0);
    }
187270
function distinct() {
    this._statements.push({
      grouping: 'columns',
      value: normalizeArr.apply(null, arguments),
      distinct: true
    });
    return this;
  }