All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.hll.dynamodbmapper.expressions.BooleanFuncExpr.kt Maven / Gradle / Ivy

There is a newer version: 1.3.73-beta
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */
package aws.sdk.kotlin.hll.dynamodbmapper.expressions

import aws.sdk.kotlin.hll.dynamodbmapper.expressions.internal.BooleanFuncExprImpl
import aws.smithy.kotlin.runtime.ExperimentalApi

/**
 * Represents a function expression that yields a boolean result as described in
 * [DynamoDB's **function** documentation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html#Expressions.OperatorsAndFunctions.Functions)
 */
@ExperimentalApi
public interface BooleanFuncExpr :
    BooleanExpr,
    SortKeyExpr {
    /**
     * The specific boolean function to use
     */
    public val func: BooleanFunc

    /**
     * The attribute path to pass as the function's first argument
     */
    public val path: AttributePath

    /**
     * Any additional arguments used by the function
     */
    public val additionalOperands: List

    override fun  accept(visitor: ExpressionVisitor): T = visitor.visit(this)
}

/**
 * Creates a new boolean function expression
 * @param func The specific boolean function to use
 * @param path The attribute path to pass as the function's first argument
 * @param additionalOperands Any additional arguments used by the function
 */
@ExperimentalApi
public fun BooleanFuncExpr(
    func: BooleanFunc,
    path: AttributePath,
    additionalOperands: List = listOf(),
): BooleanFuncExpr = BooleanFuncExprImpl(func, path, additionalOperands)

/**
 * Creates a new boolean function expression
 * @param func The specific boolean function to use
 * @param path The attribute path to pass as the function's first argument
 * @param additionalOperands Any additional arguments used by the function
 */
@ExperimentalApi
public fun BooleanFuncExpr(
    func: BooleanFunc,
    path: AttributePath,
    vararg additionalOperands: Expression,
): BooleanFuncExpr = BooleanFuncExprImpl(func, path, additionalOperands.toList())




© 2015 - 2024 Weber Informatics LLC | Privacy Policy