Packages

final class Gid[A] extends BoundedEnumerable[A] with Order[A] with Show[A] with Encoder[A] with Decoder[A]

A typeclass for Lucuma identifiers, which are of the form T-26fd21b3 where T is a constant, type-specific tag and the remainder is a positive hex-encoded Long, with lowercase alpha digits and no leading zeros (thus having a unique string representation).

case class Foo(id: Foo.Id, ...)
object Foo {
  case class Id(value: PosLong)
  object Id {
    implicit val GidId: Gid[Id] =
      Gid.instance('f', _.value, apply)
  }
}

Database tables can use such values as primary keys.

CREATE DOMAIN foo_dom AS VARCHAR CHECK(VALUE ~ '^f-([1-9a-f][0-9a-f]*)$');
CREATE SEQUENCE foo_seq START WITH 256;
CREATE TABLE foo (
  foo_id  varchar NOT NULL PRIMARY KEY DEFAULT 'f-' || to_hex(nextval('foo_seq')),
  ...
)
Source
Gid.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gid
  2. Decoder
  3. Encoder
  4. Show
  5. ContravariantShow
  6. Order
  7. PartialOrder
  8. Eq
  9. Serializable
  10. BoundedEnumerable
  11. PartialNextLowerBounded
  12. LowerBounded
  13. PartialPreviousUpperBounded
  14. UpperBounded
  15. PartialNext
  16. PartialPrevious
  17. AnyRef
  18. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Gid(tag: Refined[Char, Letter], isoPosLong: Iso[A, PosLong])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def apply(a: A): Json
    Definition Classes
    Gid → Encoder
  5. final def apply(c: HCursor): Result[A]
    Definition Classes
    Gid → Decoder
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. final def at(field: String): Decoder[A]
    Definition Classes
    Decoder
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  9. final def compare(a: A, b: A): Int
    Definition Classes
    Gid → Order
  10. def comparison(x: A, y: A): Comparison
    Definition Classes
    Order
  11. final def contramap[B](f: (B) => A): Encoder[B]
    Definition Classes
    Encoder
  12. def cycleNext(a: A): A
    Definition Classes
    BoundedEnumerable
  13. def cyclePrevious(a: A): A
    Definition Classes
    BoundedEnumerable
  14. def decodeAccumulating(c: HCursor): AccumulatingResult[A]
    Definition Classes
    Decoder
  15. final def decodeJson(j: Json): Result[A]
    Definition Classes
    Decoder
  16. final def either[B](decodeB: Decoder[B]): Decoder[Either[A, B]]
    Definition Classes
    Decoder
  17. final def emap[B](f: (A) => Either[String, B]): Decoder[B]
    Definition Classes
    Decoder
  18. final def emapTry[B](f: (A) => Try[B]): Decoder[B]
    Definition Classes
    Decoder
  19. final def ensure(errors: (A) => List[String]): Decoder[A]
    Definition Classes
    Decoder
  20. final def ensure(pred: (A) => Boolean, message: => String): Decoder[A]
    Definition Classes
    Decoder
  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. def eqv(x: A, y: A): Boolean
    Definition Classes
    Order → PartialOrder → Eq
  24. final def flatMap[B](f: (A) => Decoder[B]): Decoder[B]
    Definition Classes
    Decoder
  25. final val fromLong: Prism[Long, A]
  26. final val fromString: Prism[String, A]

    Gids have a unique String representation.

  27. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  28. def gt(x: A, y: A): Boolean
    Definition Classes
    Order → PartialOrder
  29. def gteqv(x: A, y: A): Boolean
    Definition Classes
    Order → PartialOrder
  30. final def handleErrorWith(f: (DecodingFailure) => Decoder[A]): Decoder[A]
    Definition Classes
    Decoder
  31. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. val isoPosLong: Iso[A, PosLong]
  34. final def kleisli: Kleisli[Result, HCursor, A]
    Definition Classes
    Decoder
  35. def lt(x: A, y: A): Boolean
    Definition Classes
    Order → PartialOrder
  36. def lteqv(x: A, y: A): Boolean
    Definition Classes
    Order → PartialOrder
  37. final def map[B](f: (A) => B): Decoder[B]
    Definition Classes
    Decoder
  38. final def mapJson(f: (Json) => Json): Encoder[A]
    Definition Classes
    Encoder
  39. def max(x: A, y: A): A
    Definition Classes
    Order
  40. final def maxBound: A
    Definition Classes
    Gid → UpperBounded
  41. def membersAscending: LazyList[A]
    Definition Classes
    PartialNextLowerBounded
  42. def membersDescending: LazyList[A]
    Definition Classes
    PartialPreviousUpperBounded
  43. def min(x: A, y: A): A
    Definition Classes
    Order
  44. final def minBound: A
    Definition Classes
    Gid → LowerBounded
  45. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  46. def neqv(x: A, y: A): Boolean
    Definition Classes
    Order → Eq
  47. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  48. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  49. final def or[AA >: A](d: => Decoder[AA]): Decoder[AA]
    Definition Classes
    Decoder
  50. final def order: Order[A]
    Definition Classes
    Gid → BoundedEnumerable
  51. def partialCompare(x: A, y: A): Double
    Definition Classes
    Order → PartialOrder
  52. def partialComparison(x: A, y: A): Option[Comparison]
    Definition Classes
    PartialOrder
  53. final def partialNext(a: A): Option[A]
    Definition Classes
    Gid → PartialNext
  54. def partialOrder: PartialOrder[A]
    Definition Classes
    BoundedEnumerable → LowerBounded → UpperBounded → PartialNext → PartialPrevious
  55. final def partialPrevious(a: A): Option[A]
    Definition Classes
    Gid → PartialPrevious
  56. def pmax(x: A, y: A): Option[A]
    Definition Classes
    PartialOrder
  57. def pmin(x: A, y: A): Option[A]
    Definition Classes
    PartialOrder
  58. final def prepare(f: (ACursor) => ACursor): Decoder[A]
    Definition Classes
    Decoder
  59. final def product[B](fb: Decoder[B]): Decoder[(A, B)]
    Definition Classes
    Decoder
  60. final val regexPattern: String
  61. final def show(a: A): String
    Definition Classes
    Gid → ContravariantShow
  62. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  63. val tag: Refined[Char, Letter]
  64. def toOrdering: Ordering[A]
    Definition Classes
    Order
  65. def toString(): String
    Definition Classes
    AnyRef → Any
  66. def tryCompare(x: A, y: A): Option[Int]
    Definition Classes
    PartialOrder
  67. def tryDecode(c: ACursor): Result[A]
    Definition Classes
    Decoder
  68. def tryDecodeAccumulating(c: ACursor): AccumulatingResult[A]
    Definition Classes
    Decoder
  69. final def validate(pred: (HCursor) => Boolean, message: => String): Decoder[A]
    Definition Classes
    Decoder
  70. final def validate(errors: (HCursor) => List[String]): Decoder[A]
    Definition Classes
    Decoder
  71. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  72. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  73. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  74. final def withErrorMessage(message: String): Decoder[A]
    Definition Classes
    Decoder

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Decoder[A]

Inherited from Encoder[A]

Inherited from Show[A]

Inherited from ContravariantShow[A]

Inherited from Order[A]

Inherited from PartialOrder[A]

Inherited from Eq[A]

Inherited from Serializable

Inherited from BoundedEnumerable[A]

Inherited from PartialNextLowerBounded[A]

Inherited from LowerBounded[A]

Inherited from PartialPreviousUpperBounded[A]

Inherited from UpperBounded[A]

Inherited from PartialNext[A]

Inherited from PartialPrevious[A]

Inherited from AnyRef

Inherited from Any

Ungrouped