Skip to content

Instantly share code, notes, and snippets.

@TEGRAXD
Last active March 6, 2021 17:57
Show Gist options
  • Select an option

  • Save TEGRAXD/d6100c7e0ade5ff453e11f4e4984519d to your computer and use it in GitHub Desktop.

Select an option

Save TEGRAXD/d6100c7e0ade5ff453e11f4e4984519d to your computer and use it in GitHub Desktop.
Pair And Title - Penta Kotlin Custom Class
data class Penta<out A, out B, out C, out D, out E> (
val first: A,
val second: B,
val third: C,
val fourth: D,
val fifth: E
) : Serializable {
override fun toString(): String = "($first, $second, $third, $fourth, $fifth)"
}
fun <T> Penta<T, T, T, T, T>.toList(): List<T> = listOf(first, second, third, fourth, fifth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment