FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Kotlin Enum Class Patterns — Properties, Functions & Serialization
How-ToProgramming Languages

Kotlin Enum Class Patterns — Properties, Functions & Serialization

via Dev.to BeginnersmyougaTheAxo1mo ago

What You'll Learn Practical Kotlin enum class patterns with properties, functions, serialization, and Compose integration. Basic Enum enum class Priority { LOW , MEDIUM , HIGH , URGENT } val p = Priority . HIGH println ( p . name ) // HIGH println ( p . ordinal ) // 2 Priority . entries . forEach { println ( it ) } Enum with Properties enum class HttpStatus ( val code : Int , val message : String ) { OK ( 200 , "OK" ), NOT_FOUND ( 404 , "Not Found" ), INTERNAL_ERROR ( 500 , "Internal Server Error" ); val isError : Boolean get () = code >= 400 companion object { fun fromCode ( code : Int ) = entries . find { it . code == code } } } Abstract Methods enum class SortOrder { ASCENDING { override fun < T : Comparable < T >> sort ( list : List < T >) = list . sorted () }, DESCENDING { override fun < T : Comparable < T >> sort ( list : List < T >) = list . sortedDescending () }; abstract fun < T : Comparable < T >> sort ( list : List < T >): List < T > } Exhaustive When fun getTitle ( screen :

Continue reading on Dev.to Beginners

Opens in a new tab

Read Full Article
26 views

Related Articles

Percentage Change: The Most Misused Metric in Data Analysis (And How to Calculate It Correctly)
How-To

Percentage Change: The Most Misused Metric in Data Analysis (And How to Calculate It Correctly)

Medium Programming • 5d ago

I Missed This Claude Setting at First. And It Actually Matters
How-To

I Missed This Claude Setting at First. And It Actually Matters

Medium Programming • 5d ago

Instacart Promo Code: Save on Groceries in March 2026
How-To

Instacart Promo Code: Save on Groceries in March 2026

Wired • 5d ago

How a Switch Actually “Learns”: Demystifying MAC Addresses and the CAM Table
How-To

How a Switch Actually “Learns”: Demystifying MAC Addresses and the CAM Table

Medium Programming • 5d ago

This is the lowest price on a 64GB RAM kit I've seen in months
How-To

This is the lowest price on a 64GB RAM kit I've seen in months

ZDNet • 5d ago

Discover More Articles