ExpirationCollection

@ApiStatus.Experimental
@ApiStatus.AvailableSince(value = "5.0.0")
interface ExpirationCollection<E> : Collection<E>

The basic interface for implementing a collection of expiring elements.

Parameters

E

The type of element in the collection.

Functions

Link copied to clipboard
abstract fun add(element: E, expireIn: Duration, onExpire: ExpirationCallback<E>? = null)

Adds the given element to the collection.

Link copied to clipboard
abstract fun addAll(expireIn: Duration, vararg elements: E, onExpire: ExpirationCallback<E>? = null)

Adds all the given elements to the collection.

Link copied to clipboard
abstract fun addFirst(element: E, expireIn: Duration, onExpire: ExpirationCallback<E>? = null)

Adds the given element to the beginning of the collection.

Link copied to clipboard
abstract fun addLast(element: E, expireIn: Duration, onExpire: ExpirationCallback<E>? = null)

Adds the given element to the end of the collection. This is the same as add.

Link copied to clipboard
abstract fun clear(callCallbacks: Boolean = false)

Removes all the elements from the collection, possibly calling the callback on each element.

Link copied to clipboard
abstract operator fun contains(element: E): Boolean
Link copied to clipboard
abstract fun containsAll(elements: Collection<E>): Boolean
Link copied to clipboard
abstract fun first(): E?

Provides the element at the beginning of the collection.

Link copied to clipboard
open fun forEach(p0: Consumer<in E>)
Link copied to clipboard
abstract operator fun get(index: Int): E?

Provides the element at the given index in the collection.

Link copied to clipboard
abstract fun indexOf(element: E): Int

Provides the index of the given element in the collection.

Link copied to clipboard
abstract fun isEmpty(): Boolean
Link copied to clipboard
abstract operator override fun iterator(): Iterator<E>
Link copied to clipboard
abstract fun last(): E?

Provides the element at the end of the collection.

Link copied to clipboard
open fun parallelStream(): Stream<E>
Link copied to clipboard
abstract fun remove(element: E): Boolean

Removes the give element from the collection if it is present.

Link copied to clipboard
abstract fun removeAt(index: Int): E?

Removes the element at the given index from the collection if it is present.

Link copied to clipboard
abstract fun removeFirst(): E?

Removes the element at the beginning of the collection if it is present.

Link copied to clipboard
abstract fun removeLast(): E?

Removes the element at the end of the collection if it is present.

Link copied to clipboard
open override fun spliterator(): Spliterator<E>
Link copied to clipboard
open fun stream(): Stream<E>
Link copied to clipboard
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>

Properties

Link copied to clipboard
abstract val size: Int

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun Collection<String>.contains(value: String, ignoreCase: Boolean = false): Boolean
Link copied to clipboard
fun <T : KCallable<*>> Collection<T>.findKCallable(name: String, ignoreCase: Boolean = false): Option<T>
Link copied to clipboard
@JvmName(name = "findKFunction")
inline fun <R> Collection<KFunction<*>>.findKFunction(name: String, ignoreCase: Boolean = false): Option<KFunction<R>>
@JvmName(name = "findKFunction0")
inline fun <R> Collection<() -> *>.findKFunction(name: String, ignoreCase: Boolean = false): Option<() -> R>
@JvmName(name = "findKFunction1")
inline fun <R> Collection<(*) -> *>.findKFunction(name: String, ignoreCase: Boolean = false): Option<(Any) -> R>
@JvmName(name = "findKFunction2")
inline fun <R> Collection<(*, *) -> *>.findKFunction(name: String, ignoreCase: Boolean = false): Option<(*, *) -> R>
Link copied to clipboard
@JvmName(name = "findKProperty0")
inline fun <R> Collection<KProperty0<*>>.findKProperty(name: String, ignoreCase: Boolean = false): Option<KProperty0<R>>
@JvmName(name = "findKProperty1")
inline fun <R> Collection<KProperty1<*, *>>.findKProperty(name: String, ignoreCase: Boolean = false): Option<KProperty1<Any, R>>
@JvmName(name = "findKProperty2")
inline fun <R> Collection<KProperty2<*, *, *>>.findKProperty(name: String, ignoreCase: Boolean = false): Option<KProperty2<*, *, R>>
@JvmName(name = "findKPropertyMutable0")
inline fun <R> Collection<KMutableProperty0<*>>.findKProperty(name: String, ignoreCase: Boolean = false): Option<KMutableProperty0<R>>
@JvmName(name = "findKPropertyMutable1")
inline fun <R> Collection<KMutableProperty1<*, *>>.findKProperty(name: String, ignoreCase: Boolean = false): Option<KMutableProperty1<*, R>>
@JvmName(name = "findKPropertyMutable2")
inline fun <R> Collection<KMutableProperty2<*, *, *>>.findKProperty(name: String, ignoreCase: Boolean = false): Option<KMutableProperty2<*, *, R>>
Link copied to clipboard
fun <T : Any> Collection<*>.getCast(index: Int): Validated<Throwable, T>
Link copied to clipboard
inline fun <T> Collection<T>?.ifNotEmpty(block: Collection<T>.() -> Unit): Collection<T>?

Invokes the given block if the receiver is not empty.

Link copied to clipboard
@JvmName(name = "msgAudienceCollection")
infix fun Collection<ComponentLike>.msg(audience: Audience)
Link copied to clipboard
fun Collection<String>.parse(): List<Component>