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

com.dbobjekts.statement.Semaphore.kt Maven / Gradle / Ivy

There is a newer version: 0.6.0-RC2
Show newest version
package com.dbobjekts.statement

import com.dbobjekts.api.exception.StatementBuilderException

class Semaphore {

    private var statement: String? = null

    fun claim(newStatement: String) {
        if (this.statement != null) {
            throw StatementBuilderException("You are starting a new $newStatement statement, but there is still a $statement statement in progress that has not been completed yet.")
        }
        this.statement = newStatement
    }

    fun clear() {
        statement = null
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy