io.mstream.trader.commons.validation.ValidationModule Maven / Gradle / Ivy
The newest version!
package io.mstream.trader.commons.validation;
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import io.mstream.trader.commons.validation.parameter.ParameterModule;
public class ValidationModule extends AbstractModule {
@Override
protected void configure() {
binder().requireExplicitBindings();
install(new FactoryModuleBuilder()
.implement(ValidationResult.class, ValidationResult.class)
.build(ValidationResultFactory.class));
install(new ParameterModule());
bind(ValidationErrorFactory.class)
.to(ValidationErrorFactoryImpl.class)
.in(Singleton.class);
}
}