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

aecor.encoding.AnyValKeyEncoder.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0
Show newest version
package aecor.encoding

import shapeless.Unwrapped

private[encoding] sealed abstract class AnyValKeyEncoder[A] extends KeyEncoder[A]
private[encoding] object AnyValKeyEncoder {
  implicit def instance[A <: AnyVal, U](implicit A: Unwrapped.Aux[A, U],
                                        U: KeyEncoder[U]): AnyValKeyEncoder[A] =
    new AnyValKeyEncoder[A] {
      override def apply(a: A) = U.apply(A.unwrap(a))
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy