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

enumeratum.Quill.scala Maven / Gradle / Ivy

The newest version!
package enumeratum

import io.getquill.MappedEncoding

object Quill {

  /**
    * Returns an Encoder for the given enum
    */
  def encoder[A <: EnumEntry](enum: Enum[A]): MappedEncoding[A, String] =
    MappedEncoding(_.entryName)

  /**
    * Returns a Decoder for the given enum
    */
  def decoder[A <: EnumEntry](enum: Enum[A]): MappedEncoding[String, A] =
    MappedEncoding(enum.withName)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy