Interface IConfigKeyValidator<T>
- Namespace
- MonkeyLoader.Configuration
- Assembly
- MonkeyLoader.dll
Defines the interface for validator components for IDefiningConfigKey<T>s.
Multiple components of this type on one config key must all validate successfully.
public interface IConfigKeyValidator<T> : IConfigKeyComponent<IDefiningConfigKey<T>>, IComponent<IDefiningConfigKey<T>>
Type Parameters
TThe type of the config item's value.
- Inherited Members
Remarks
The validator must ensure that the config key's value is valid (if present) when the component is added. It is safe to throw an exception otherwise when initializing.
Methods
IsValid(T?)
Whether value is valid for this IDefiningConfigKey<T>.
bool IsValid(T? value)
Parameters
valueTThe value to check.
Returns
- bool
trueif thevalueis valid; otherwise,false.