of

fun <T : Any> of(registry: DefaultedRegistry<T>): ValidatedField<T>

Validation for a registry object in a DefaultedRegistry

This validation will accept any instance of an object that is registered in the provided registry. Will use the registries default value as its default.

Return

ValidatedField<T> - Validation wrapping the registry. Is a Supplier and Consumer of the current instance of T it is holding

Author

fzzyhmstrs

Since

0.5.0

Parameters

T

the object type

registry

DefaultedRegistry<T> - the registry instance


fun <T : Any> of(defaultValue: T, registry: Registry<T>): ValidatedField<T>

Validation for a registry object in a Registry, the Registry doesn't have to be Defaulted because a default is being provided.

This validation will accept any instance of an object that is registered in the provided registry.

Return

ValidatedField<T> - Validation wrapping the registry. Is a Supplier and Consumer of the current instance of T it is holding

Author

fzzyhmstrs

Since

0.5.0

Parameters

T

the object type

defaultValue

T default registry object instance

registry

Registry<T> - the registry instance

Throws

If the default provided isn't actually registered in the registry.


fun <T : Any> of(defaultValue: T, registry: Registry<T>, predicate: Predicate<RegistryEntry<T>>): ValidatedField<T>

Validation for a registry object in a Registry, the Registry doesn't have to be Defaulted because a default is being provided.

Return

ValidatedField<T> - Validation wrapping the registry. Is a Supplier and Consumer of the current instance of T it is holding

Author

fzzyhmstrs

Since

0.5.0

Parameters

T

the object type

defaultValue

T default registry object instance

registry

Registry<T> - the registry instance

predicate

Predicate<RegistryEntry<T>> - filters the allowable registry entries

Throws

If the default provided isn't actually registered in the registry.


fun <T : Any> of(defaultValue: T, registry: Registry<T>, predicate: BiPredicate<Identifier, RegistryEntry<T>>): ValidatedField<T>

Validation for a registry object in a Registry, the Registry doesn't have to be Defaulted because a default is being provided.

This validation will accept any instance of an object that is registered in the provided registry.

Return

ValidatedField<T> - Validation wrapping the registry. Is a Supplier and Consumer of the current instance of T it is holding

Author

fzzyhmstrs

Since

0.5.0

Parameters

T

the object type

defaultValue

T default registry object instance

registry

Registry<T> - the registry instance

predicate

BiPredicate<Identifier, RegistryEntry<T>> - filters the allowable registry entries

Throws

If the default provided isn't actually registered in the registry.