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

no.nav.nare.core.evaluations.Resultat.kt Maven / Gradle / Ivy

Go to download

NARE is a variation over the Specification pattern, as described by Eric Evans and Martin Fowler

The newest version!
package no.nav.nare.core.evaluations

enum class Resultat {
   JA {
      override infix fun og(other: Resultat): Resultat = other
      override infix fun eller(other: Resultat): Resultat = JA
      override fun ikke(): Resultat = NEI
   },

   NEI {
      override infix fun og(other: Resultat): Resultat = NEI
      override infix fun eller(other: Resultat): Resultat = other
      override fun ikke(): Resultat = JA
   },

   KANSKJE {
      override infix fun og(other: Resultat): Resultat = if (other == JA) KANSKJE else other
      override infix fun eller(other: Resultat): Resultat = if (other == NEI) KANSKJE else other
      override fun ikke(): Resultat = KANSKJE
   };

   abstract infix fun og(other: Resultat): Resultat
   abstract infix fun eller(other: Resultat): Resultat
   abstract fun ikke(): Resultat
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy