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

net.chestmc.common.placeholder.Placeholder.kt Maven / Gradle / Ivy

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