hasEnumNamed

Full name: taxi.stdlib.hasEnumNamed

Signature

declare extension function <T> hasEnumNamed(enumType: lang.taxi.Type<T>, enumName: String): Boolean

Description

Returns true if the enum has an explicitly declared member matching the provided name.

Ignores default entries — an enum with a default value will return false for a name that is only matched by the default, not by an explicit declaration.

find {
   valid: Boolean = hasEnumNamed(OrderStatus, "PENDING")
}

Examples

Returns true for a declared enum member name, false for a name not in the enum.

Try it out

Schema
Query Plan
Play with this snippet by editing it here, or edit it on Taxi Playground
Result
Query failed
Next
Welcome to Taxi