Animal

sttp.tapir.server.tests.Animal
See theAnimal companion trait
object Animal extends Enum[Animal], TapirCodecEnumeratum

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
trait TapirCodecEnumeratum
trait Enum[Animal]
class Object
trait Matchable
class Any
Show all
Self type
Animal.type

Members list

Type members

Classlikes

case object Cat extends Animal

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Animal
trait Lowercase
trait EnumEntry
class Object
trait Matchable
class Any
Show all
Self type
Cat.type
case object Dog extends Animal

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Animal
trait Lowercase
trait EnumEntry
class Object
trait Matchable
class Any
Show all
Self type
Dog.type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

override def values: IndexedSeq[Animal]

The sequence of values for your Enum. You will typically want to implement this in your extending class as a val so that withName and friends are as efficient as possible.

The sequence of values for your Enum. You will typically want to implement this in your extending class as a val so that withName and friends are as efficient as possible.

Feel free to implement this however you'd like (including messing around with ordering, etc) if that fits your needs better.

Attributes

Definition Classes
EnumCompat

Inherited methods

def extraNamesToValuesMap: Map[String, A]

Additional list of names which can be mapped to values, for example to allow mapping of legacy values.

Additional list of names which can be mapped to values, for example to allow mapping of legacy values.

Attributes

Returns

a Map of names to Values

Inherited from:
Enum
inline def findValues: IndexedSeq[A]

Returns a Seq of A objects that the macro was able to find.

Returns a Seq of A objects that the macro was able to find.

You will want to use this in some way to implement your values method. In fact, if you aren't using this method... why are you even bothering with this lib?

Attributes

Inherited from:
EnumCompat (hidden)
def indexOf(member: Animal): Int

Returns the index number of the member passed in the values picked up by this enum

Returns the index number of the member passed in the values picked up by this enum

Value parameters

member

the member you want to check the index of

Attributes

Returns

the index of the first element of values that is equal (as determined by ==) to member, or -1, if none exists.

Inherited from:
Enum
def plainCodecEnumEntryDecodeCaseInsensitive[E <: EnumEntry](implicit enum: Enum[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
def plainCodecEnumEntryUsing[E <: EnumEntry](f: String => Option[E])(implicit enum: Enum[E]): Codec[String, E, TextPlain]

Attributes

Inherited from:
TapirCodecEnumeratum
def plainCodecValueEnumEntry[T, E <: ValueEnumEntry[T]](implicit enum: ValueEnum[T, E], baseCodec: PlainCodec[T], schema: Schema[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
def validatorEnumEntry[E <: EnumEntry](implicit enum: Enum[E]): Enumeration[E]

Attributes

Inherited from:
TapirCodecEnumeratum
def validatorValueEnumEntry[T, E <: ValueEnumEntry[T]](implicit enum: ValueEnum[T, E]): Validator[E]

Attributes

Inherited from:
TapirCodecEnumeratum
def withName(name: String): A

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A

Like Enumeration 's withName, this method will throw if the name does not match any of the values' .entryName values.

Attributes

Inherited from:
Enum
def withNameEither(name: String): Either[NoSuchMember[A], A]

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values.

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values.

Attributes

Inherited from:
Enum
def withNameInsensitive(name: String): A

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A, disregarding case

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A, disregarding case

Like Enumeration 's withName, this method will throw if the name does not match any of the values' .entryName values.

Attributes

Inherited from:
Enum
def withNameInsensitiveEither(name: String): Either[NoSuchMember[A], A]

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values, disregarding case.

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values, disregarding case.

Attributes

Inherited from:
Enum
def withNameInsensitiveOption(name: String): Option[A]

Optionally returns an A for a given name, disregarding case

Optionally returns an A for a given name, disregarding case

Attributes

Inherited from:
Enum
def withNameLowercaseOnly(name: String): A

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A transformed to lower case

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A transformed to lower case

Like Enumeration 's withName, this method will throw if the name does not match any of the values' .entryName values.

Attributes

Inherited from:
Enum
def withNameLowercaseOnlyEither(name: String): Either[NoSuchMember[A], A]

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values, disregarding case.

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values, disregarding case.

Attributes

Inherited from:
Enum
def withNameLowercaseOnlyOption(name: String): Option[A]

Optionally returns an A for a given name assuming the value is lower case

Optionally returns an A for a given name assuming the value is lower case

Attributes

Inherited from:
Enum
def withNameOption(name: String): Option[A]

Optionally returns an A for a given name.

Optionally returns an A for a given name.

Attributes

Inherited from:
Enum
def withNameUppercaseOnly(name: String): A

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A transformed to upper case

Tries to get an A by the supplied name. The name corresponds to the .name of the case objects implementing A transformed to upper case

Like Enumeration 's withName, this method will throw if the name does not match any of the values' .entryName values.

Attributes

Inherited from:
Enum
def withNameUppercaseOnlyEither(name: String): Either[NoSuchMember[A], A]

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values, disregarding case.

Returns an [[Right[A]] ] for a given name, or a [[Left[NoSuchMember]] ] if the name does not match any of the values' .entryName values, disregarding case.

Attributes

Inherited from:
Enum
def withNameUppercaseOnlyOption(name: String): Option[A]

Optionally returns an A for a given name assuming the value is upper case

Optionally returns an A for a given name assuming the value is upper case

Attributes

Inherited from:
Enum

Inherited fields

final lazy val lowerCaseNamesToValuesMap: Map[String, Animal]

Map of A object names in lower case to A s for case-insensitive comparison

Map of A object names in lower case to A s for case-insensitive comparison

Attributes

Inherited from:
Enum
lazy val namesToValuesMap: Map[String, Animal]

Map of A object names to A s

Map of A object names to A s

Attributes

Inherited from:
Enum
final lazy val upperCaseNameValuesToMap: Map[String, Animal]

Map of A object names in upper case to A s for case-insensitive comparison

Map of A object names in upper case to A s for case-insensitive comparison

Attributes

Inherited from:
Enum
final lazy val valuesToIndex: Map[Animal, Int]

Map of A to their index in the values sequence.

Map of A to their index in the values sequence.

A performance optimisation so that indexOf can be found in constant time.

Attributes

Inherited from:
Enum

Implicits

Inherited implicits

implicit def plainCodecByteEnumEntry[E <: ByteEnumEntry](implicit enum: ByteEnum[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def plainCodecEnumEntry[E <: EnumEntry](implicit enum: Enum[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def plainCodecIntEnumEntry[E <: IntEnumEntry](implicit enum: IntEnum[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def plainCodecLongEnumEntry[E <: LongEnumEntry](implicit enum: LongEnum[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def plainCodecShortEnumEntry[E <: ShortEnumEntry](implicit enum: ShortEnum[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def plainCodecStringEnumEntry[E <: StringEnumEntry](implicit enum: StringEnum[E]): PlainCodec[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def schemaForByteEnumEntry[E <: ByteEnumEntry](implicit annotations: SchemaAnnotations[E], enum: ByteEnum[E]): Schema[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def schemaForCharEnumEntry[E <: CharEnumEntry](implicit annotations: SchemaAnnotations[E], enum: CharEnum[E]): Schema[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def schemaForEnumEntry[E <: EnumEntry](implicit annotations: SchemaAnnotations[E], enum: Enum[E]): Schema[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def schemaForIntEnumEntry[E <: IntEnumEntry](implicit annotations: SchemaAnnotations[E], enum: IntEnum[E]): Schema[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def schemaForLongEnumEntry[E <: LongEnumEntry](implicit annotations: SchemaAnnotations[E], enum: LongEnum[E]): Schema[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def schemaForShortEnumEntry[E <: ShortEnumEntry](implicit annotations: SchemaAnnotations[E], enum: ShortEnum[E]): Schema[E]

Attributes

Inherited from:
TapirCodecEnumeratum
implicit def schemaForStringEnumEntry[E <: StringEnumEntry](implicit annotations: SchemaAnnotations[E], enum: StringEnum[E]): Schema[E]

Attributes

Inherited from:
TapirCodecEnumeratum