net.chestmc.common.placeholder.Placeholder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chest-server Show documentation
Show all versions of chest-server Show documentation
A spigot fork to kotlin structure and news.
The newest version!
package net.chestmc.common.placeholder
/**
* Represents a placeholder, this is, a generic type [T] can be processed to stores
* certains datas to a string by the specified placeholder.
*/
interface Placeholder {
/**
* Process all placeholders that [T] can be have.
*/
fun process(string: String, value: T): String
}
/**
* Process all placeholders of the specified array that [T] can be have.
*/
fun Placeholder.process(array: Array, value: T): List =
array.map { process(it, value) }
/**
* Process all placeholders of the specified iterable that [T] can be have.
*/
fun Placeholder.process(iterable: Iterable, value: T): List =
iterable.map { process(it, value) }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy