WireNames

object WireNames

How Wow spells a value on the wire: lower-kebab, as its headers, server-sent event names and error codes are. A Wow enumeration's value is its constant's name in lower case, words joined by hyphens (CATCH_UP is catch-up); a violation's code is its constraint's name so spelled (NotBlank is not-blank, UNKNOWN_FIELD is unknown-field). A domain's own enumerations are the domain's: Wow never respells them.

Functions

Link copied to clipboard
inline fun <reified E : Enum<E>> entryOf(wire: String): E?

The constant of E whose wire name is wire, or null when none is: catch-up is CATCH_UP, CATCH_UP none.

Link copied to clipboard
inline fun <reified E : Enum<E>> namesOf(): List<String>

The wire names of E's constants, in their order.

Link copied to clipboard
fun of(value: Enum<*>): String

The wire name of value, a constant of a Wow enumeration: CATCH_UP is catch-up.

fun of(name: String): String

name in lower-kebab: a word starts at an upper-case letter after a lower-case letter or a digit, and at the last letter of an upper-case run followed by a lower-case one; underscores separate words too. NotBlank is not-blank, UNKNOWN_FIELD is unknown-field, URLPattern is url-pattern.