commonMain.entity.Entity.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kord-core Show documentation
Show all versions of kord-core Show documentation
Idiomatic Kotlin Wrapper for The Discord API
package dev.kord.core.entity
import dev.kord.common.entity.Snowflake
import dev.kord.core.KordObject
public interface Entity : Comparable {
/**
* The unique identifier of this entity.
*/
public val id: Snowflake
/**
* Compares entities on [id].
*/
override operator fun compareTo(other: Entity): Int = comparator.compare(this, other)
public companion object {
public val comparator: Comparator = compareBy(Entity::id)
}
}
/**
* An object that is identified by its [id].
* This object holds a [KordObject]
*/
public interface KordEntity : KordObject, Entity