Enums

The following enums are available globally.

  • Key

    Mechanica

    Base enum for static keys with a phantom type. Specialize this enum with a type and initialize it with a key, key path (both namespaced or not).

    Note

    Use Key to avoid stringly typed APIs.

  • simple: a String key or key path.

  • namespaced: a namespaced String key or key path.

  • Example:

    Key<String>("myKey1") // value: myKey1
    Key<Int>("myKey2", namespace: "org.tinrobots")  // value: org.tinrobots.myKey2
    Key<Bool>("myKey3", namespace: "org.tinrobots") // value: org.tinrobots.myKey3
    Key<Double>("myKey4", namespace: "org", "tinrobots") // value: org.tinrobots.myKey4
    
    See more

    Declaration

    Swift

    public enum Key<T>: CustomStringConvertible