Class SingleRowFunctions

java.lang.Object
io.github.torand.fastersql.function.singlerow.SingleRowFunctions

public final class SingleRowFunctions extends Object
Provides factory methods for single row functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Abs
    abs(Expression expression)
    Creates the ABS function for a numeric expression.
    static Abs
    abs(Number constantValue)
    Creates the ABS function for a numeric constant value.
    cast(Expression expression)
    Creates the CAST function for an expression.
    cast(Number value)
    Creates the CAST function for a constant value.
    cast(String value)
    Creates the CAST function for a constant value.
    static Ceil
    ceil(Expression expression)
    Creates the CEIL function for a numeric expression.
    static Ceil
    ceil(Number constantValue)
    Creates the CEIL function for a numeric constant value.
    static Concat
    concat(Expression expression1, Expression expression2, Expression... otherExpressions)
    Creates the CONCAT function for two or more string expressions.
    static Exp
    exp(Expression expression)
    Creates the EXP (natural exponential) function for a numeric expression.
    static Exp
    exp(Number constantValue)
    Creates the EXP (natural exponential) function for a numeric constant value.
    static Floor
    floor(Expression expression)
    Creates the FLOOR function for a numeric expression.
    static Floor
    floor(Number constantValue)
    Creates the FLOOR function for a numeric constant value.
    static Length
    length(Expression expression)
    Creates the LENGTH function for a string expression.
    static Length
    length(String constantValue)
    Creates the LENGTH function for a string constant value.
    static Ln
    ln(Expression expression)
    Creates the LN (natural logarithm) function for a numeric expression.
    static Ln
    ln(Number constantValue)
    Creates the LN (natural logarithm) function for a numeric constant value.
    static Lower
    lower(Expression expression)
    Creates the LOWER function for a string expression.
    static Lower
    lower(String constantValue)
    Creates the LOWER function for a string constant value.
    static Power
    pow(Expression base, Expression exponent)
    Creates the POW (exponentiation) function for a numeric expression.
    static Power
    pow(Expression base, Number exponent)
    Creates the POW (exponentiation) function for a numeric expression with constant value exponent.
    static Round
    round(Expression expression)
    Creates the ROUND function for a numeric expression.
    static Round
    round(Number constantValue)
    Creates the ROUND function for a numeric constant value.
    static Sqrt
    sqrt(Expression expression)
    Creates the SQRT (square root) function for a numeric expression.
    static Sqrt
    sqrt(Number constantValue)
    Creates the SQRT (square root) function for a numeric constant value.
    static Substring
    substring(Expression expression, int startPos, int length)
    Creates the SUBSTRING function for a string expression.
    static Substring
    substring(String constantValue, int startPos, int length)
    Creates the SUBSTRING function for a string constant value.
    static ToChar
    toChar(Expression expression, String format)
    Creates the TO_CHAR function converting from a timestamp/number expression to string.
    static ToNumber
    toNumber(Expression expression, int precision)
    Creates the TO_NUMBER function converting from a string expression to integer.
    static ToNumber
    toNumber(Expression expression, int precision, int scale)
    Creates the TO_NUMBER function converting from a string expression to decimal number.
    static ToNumber
    toNumber(String constantValue, int precision)
    Creates the TO_NUMBER function converting from a string constant value to integer.
    static ToNumber
    toNumber(String constantValue, int precision, int scale)
    Creates the TO_NUMBER function converting from a string constant value to decimal number.
    static Upper
    upper(Expression expression)
    Creates the UPPER function for a string expression.
    static Upper
    upper(String constantValue)
    Creates the UPPER function for a string constant value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • upper

      public static Upper upper(Expression expression)
      Creates the UPPER function for a string expression.
      Parameters:
      expression - the string expression.
      Returns:
      the string function.
    • upper

      public static Upper upper(String constantValue)
      Creates the UPPER function for a string constant value.
      Parameters:
      constantValue - the string value.
      Returns:
      the string function.
    • lower

      public static Lower lower(Expression expression)
      Creates the LOWER function for a string expression.
      Parameters:
      expression - the string expression.
      Returns:
      the string function.
    • lower

      public static Lower lower(String constantValue)
      Creates the LOWER function for a string constant value.
      Parameters:
      constantValue - the string value.
      Returns:
      the string function.
    • toNumber

      public static ToNumber toNumber(Expression expression, int precision, int scale)
      Creates the TO_NUMBER function converting from a string expression to decimal number.
      Parameters:
      expression - the string expression.
      precision - the total number of digits (including decimals).
      scale - the number of decimals.
      Returns:
      the conversion function.
    • toNumber

      public static ToNumber toNumber(String constantValue, int precision, int scale)
      Creates the TO_NUMBER function converting from a string constant value to decimal number.
      Parameters:
      constantValue - the string value.
      precision - the total number of digits (including decimals).
      scale - the number of decimals.
      Returns:
      the conversion function.
    • toNumber

      public static ToNumber toNumber(Expression expression, int precision)
      Creates the TO_NUMBER function converting from a string expression to integer.
      Parameters:
      expression - the string expression.
      precision - the total number of digits.
      Returns:
      the conversion function.
    • toNumber

      public static ToNumber toNumber(String constantValue, int precision)
      Creates the TO_NUMBER function converting from a string constant value to integer.
      Parameters:
      constantValue - the string value.
      precision - the total number of digits.
      Returns:
      the conversion function.
    • substring

      public static Substring substring(Expression expression, int startPos, int length)
      Creates the SUBSTRING function for a string expression.
      Parameters:
      expression - the string expression.
      startPos - the substring start position, 1-based.
      length - the substring length.
      Returns:
      the string function.
    • substring

      public static Substring substring(String constantValue, int startPos, int length)
      Creates the SUBSTRING function for a string constant value.
      Parameters:
      constantValue - the string value.
      startPos - the substring start position, 1-based.
      length - the substring length.
      Returns:
      the string function.
    • toChar

      public static ToChar toChar(Expression expression, String format)
      Creates the TO_CHAR function converting from a timestamp/number expression to string.
      Parameters:
      expression - the timestamp or number expression.
      format - the format specifier.
      Returns:
      the conversion function.
    • concat

      public static Concat concat(Expression expression1, Expression expression2, Expression... otherExpressions)
      Creates the CONCAT function for two or more string expressions.
      Parameters:
      expression1 - the first string expression.
      expression2 - the second string expression.
      otherExpressions - the additional string expressions.
      Returns:
      the string function.
    • length

      public static Length length(Expression expression)
      Creates the LENGTH function for a string expression.
      Parameters:
      expression - the string expression.
      Returns:
      the string function.
    • length

      public static Length length(String constantValue)
      Creates the LENGTH function for a string constant value.
      Parameters:
      constantValue - the string value.
      Returns:
      the string function.
    • round

      public static Round round(Expression expression)
      Creates the ROUND function for a numeric expression.
      Parameters:
      expression - the numeric expression.
      Returns:
      the numeric function.
    • round

      public static Round round(Number constantValue)
      Creates the ROUND function for a numeric constant value.
      Parameters:
      constantValue - the numeric value.
      Returns:
      the numeric function.
    • abs

      public static Abs abs(Expression expression)
      Creates the ABS function for a numeric expression.
      Parameters:
      expression - the numeric expression.
      Returns:
      the numeric function.
    • abs

      public static Abs abs(Number constantValue)
      Creates the ABS function for a numeric constant value.
      Parameters:
      constantValue - the numeric value.
      Returns:
      the numeric function.
    • ceil

      public static Ceil ceil(Expression expression)
      Creates the CEIL function for a numeric expression.
      Parameters:
      expression - the numeric expression.
      Returns:
      the numeric function.
    • ceil

      public static Ceil ceil(Number constantValue)
      Creates the CEIL function for a numeric constant value.
      Parameters:
      constantValue - the numeric value.
      Returns:
      the numeric function.
    • floor

      public static Floor floor(Expression expression)
      Creates the FLOOR function for a numeric expression.
      Parameters:
      expression - the numeric expression.
      Returns:
      the numeric function.
    • floor

      public static Floor floor(Number constantValue)
      Creates the FLOOR function for a numeric constant value.
      Parameters:
      constantValue - the numeric value.
      Returns:
      the numeric function.
    • ln

      public static Ln ln(Expression expression)
      Creates the LN (natural logarithm) function for a numeric expression.
      Parameters:
      expression - the numeric expression.
      Returns:
      the numeric function.
    • ln

      public static Ln ln(Number constantValue)
      Creates the LN (natural logarithm) function for a numeric constant value.
      Parameters:
      constantValue - the numeric value.
      Returns:
      the numeric function.
    • exp

      public static Exp exp(Expression expression)
      Creates the EXP (natural exponential) function for a numeric expression.
      Parameters:
      expression - the numeric expression.
      Returns:
      the numeric function.
    • exp

      public static Exp exp(Number constantValue)
      Creates the EXP (natural exponential) function for a numeric constant value.
      Parameters:
      constantValue - the numeric value.
      Returns:
      the numeric function.
    • sqrt

      public static Sqrt sqrt(Expression expression)
      Creates the SQRT (square root) function for a numeric expression.
      Parameters:
      expression - the numeric expression.
      Returns:
      the numeric function.
    • sqrt

      public static Sqrt sqrt(Number constantValue)
      Creates the SQRT (square root) function for a numeric constant value.
      Parameters:
      constantValue - the numeric value.
      Returns:
      the numeric function.
    • pow

      public static Power pow(Expression base, Expression exponent)
      Creates the POW (exponentiation) function for a numeric expression.
      Parameters:
      base - the numeric base expression.
      exponent - the numeric exponent expression.
      Returns:
      the numeric function.
    • pow

      public static Power pow(Expression base, Number exponent)
      Creates the POW (exponentiation) function for a numeric expression with constant value exponent.
      Parameters:
      base - the numeric base expression.
      exponent - the numeric exponent value.
      Returns:
      the numeric function.
    • cast

      public static CastBuilder cast(Expression expression)
      Creates the CAST function for an expression.
      Parameters:
      expression - the expression.
      Returns:
      the CAST function builder.
    • cast

      public static CastBuilder cast(String value)
      Creates the CAST function for a constant value.
      Parameters:
      value - the constant value.
      Returns:
      the CAST function builder.
    • cast

      public static CastBuilder cast(Number value)
      Creates the CAST function for a constant value.
      Parameters:
      value - the constant value.
      Returns:
      the CAST function builder.