Class Expressions

    • Method Detail

      • getValuesOrThrowIfExpression

        public static <T> SortedSet<T> getValuesOrThrowIfExpression​(Collection<ValueOrExpression<T>> wrappedValues,
                                                                    Comparator<T> comparator)
                                                             throws ExpressionException
        Returns a sorted set containing values from the provided collection of wrapped values.

        This method must be used when type T is not comparable. If T is comparable, then equivalent method without a comparator argument can be used.

        Type Parameters:
        T - The type of the values, which need not be comparable.
        Parameters:
        wrappedValues - The wrapped values to be sorted.
        comparator - The comparator for values of type T.
        Returns:
        a sorted set containing the provided values
        Throws:
        ExpressionException - If the set contains an expression.
      • getValuesOrThrowIfExpression

        public static <T extends Comparable<T>> SortedSet<T> getValuesOrThrowIfExpression​(Collection<ValueOrExpression<T>> wrappedValues)
                                                                                   throws ExpressionException
        Returns a sorted set containing values from the provided collection of wrapped values.

        This method can only be used when type T is comparable. If T is not comparable, then the equivalent method with the comparator argument must be used.

        Type Parameters:
        T - The type of the values, which need not be comparable.
        Parameters:
        wrappedValues - The wrapped values to be sorted.
        Returns:
        a sorted set containing the provided values
        Throws:
        ExpressionException - if the set contains an expression
      • asSetOfValueOrExpression

        public static <T> Collection<ValueOrExpression<T>> asSetOfValueOrExpression​(Collection<T> values)
        Returns a collection of wrapped values from the provided collection of values.
        Type Parameters:
        T - the type of the values
        Parameters:
        values - values to wrap
        Returns:
        a collection of wrapped values
      • asSetOfValueOrExpression

        @SafeVarargs
        public static <T> Collection<ValueOrExpression<T>> asSetOfValueOrExpression​(T... values)
        Returns a collection of wrapped values from the provided values.
        Type Parameters:
        T - the type of the values
        Parameters:
        values - values to wrap
        Returns:
        a collection of wrapped values