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

lucuma.core.enums.GnirsDecker.scala Maven / Gradle / Ivy

There is a newer version: 0.108.0
Show newest version
// Copyright (c) 2016-2023 Association of Universities for Research in Astronomy, Inc. (AURA)
// For license information see LICENSE or https://opensource.org/licenses/BSD-3-Clause

package lucuma
package core
package enums
import cats.syntax.eq.*
import lucuma.core.util.Enumerated

/**
 * Enumerated type for GNRIS Decker.
 * @group Enumerations (Generated)
 */
sealed abstract class GnirsDecker(
  val tag: String,
  val shortName: String,
  val longName: String,
  val obsolete: Boolean
) extends Product with Serializable

object GnirsDecker {

  /** @group Constructors */ case object Acquisition extends GnirsDecker("Acquisition", "Acquisition", "Acquisition", false)
  /** @group Constructors */ case object PupilViewer extends GnirsDecker("PupilViewer", "Pupil", "Pupil viewer", false)
  /** @group Constructors */ case object ShortCamCrossDispersed extends GnirsDecker("ShortCamCrossDispersed", "Short camera XD", "Short camera cross dispersed", false)
  /** @group Constructors */ case object Ifu extends GnirsDecker("Ifu", "IFU", "Integral field unit", true)
  /** @group Constructors */ case object LongCamLongSlit extends GnirsDecker("LongCamLongSlit", "Long camera slit", "Long camera long slit", false)
  /** @group Constructors */ case object Wollaston extends GnirsDecker("Wollaston", "Wollaston", "Wollaston", true)
  /** @group Constructors */ case object ShortCamLongSlit extends GnirsDecker("ShortCamLongSlit", "Short camera slit", "Short camera long slit", false)
  /** @group Constructors */ case object LongCamCrossDispersed extends GnirsDecker("LongCamCrossDispersed", "Long camera XD", "Long camera cross dispersed", false)

  /** All members of GnirsDecker, in canonical order. */
  val all: List[GnirsDecker] =
    List(Acquisition, PupilViewer, ShortCamCrossDispersed, Ifu, LongCamLongSlit, Wollaston, ShortCamLongSlit, LongCamCrossDispersed)

  /** Select the member of GnirsDecker with the given tag, if any. */
  def fromTag(s: String): Option[GnirsDecker] =
    all.find(_.tag === s)

  /** Select the member of GnirsDecker with the given tag, throwing if absent. */
  def unsafeFromTag(s: String): GnirsDecker =
    fromTag(s).getOrElse(throw new NoSuchElementException(s"GnirsDecker: Invalid tag: '$s'"))

  /** @group Typeclass Instances */
  implicit val GnirsDeckerEnumerated: Enumerated[GnirsDecker] =
    new Enumerated[GnirsDecker] {
      def all = GnirsDecker.all
      def tag(a: GnirsDecker) = a.tag
      override def unsafeFromTag(s: String): GnirsDecker =
        GnirsDecker.unsafeFromTag(s)
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy