Stay organized with collections
Save and categorize content based on your preferences.
BooleanSupplier
@FunctionalInterface interface BooleanSupplier
Represents a supplier of boolean
-valued results. This is the boolean
-producing primitive specialization of Supplier
.
There is no requirement that a new or distinct result be returned each time the supplier is invoked.
This is a functional interface whose functional method is getAsBoolean()
.
Summary
Public methods |
abstract Boolean |
Gets a result.
|
Public methods
getAsBoolean
abstract fun getAsBoolean(): Boolean
Gets a result.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# BooleanSupplier\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBooleanSupplier\n===============\n\n```\n@FunctionalInterface interface BooleanSupplier\n```\n\n|-----------------------------------------|\n| [java.util.function.BooleanSupplier](#) |\n\nRepresents a supplier of `boolean`-valued results. This is the `boolean`-producing primitive specialization of [Supplier](/reference/kotlin/java/util/function/Supplier).\n\nThere is no requirement that a new or distinct result be returned each time the supplier is invoked.\n\nThis is a [functional interface](/reference/kotlin/java/util/function/package-summary) whose functional method is [getAsBoolean()](#getAsBoolean()).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|----------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [getAsBoolean](#getAsBoolean())`()` Gets a result. |\n\nPublic methods\n--------------\n\n### getAsBoolean\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getAsBoolean(): Boolean\n```\n\nGets a result.\n\n| Return ||\n|------------------------------------------------------------------------------------|----------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | a result |"]]