Symbolic

interface Symbolic<T>

Symbolic

This interface maps a type T to the type to which it is applied; then, the adhering type's companion object (or any sensible object related to type T) can implement Symbolic.Resolver to provide a means of resolving the symbolic type to and from the concrete type.

Types

Link copied to clipboard

Describes an advanced resolver which operates on a factory pattern, and which carries a name. Names of resolvers implemented via this class are used in logging, errors, and other cosmetic places.

Link copied to clipboard

Describes a Symbolic type which is "closed" or "sealed" to an enumerated set of instances or symbols. Resolvers which inherit from this type will throw an exception (Unresolved) for all unresolved symbols.

Link copied to clipboard
sealed interface Resolver<T : Any, Concrete : Symbolic<T>>

Specifies the expected interface for a resolver of a symbolic type T to a concrete type Concrete. Implementors inheriting from this interface are allowed to produce null for a symbol; because of previous design decisions, the resolveSymbol method (deprecated) will throw an Unresolved exception if the symbol cannot be resolved.

Link copied to clipboard

Describes a Symbolic resolver which is "sealed" or "closed;" requests for symbols which cannot be resolved will result in an exception (Unresolved).

Link copied to clipboard

Thrown when a symbol could not be resolved, usually via the SealedResolver.unresolved method; this method is typically used from the resolver implementation only.

Properties

Link copied to clipboard
abstract val symbol: T

Return the raw symbol represented by this type.