org.hibernate.boot.registry.selector.SimpleStrategyRegistrationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.boot.registry.selector;
import java.util.Arrays;
/**
* A simple implementation of StrategyRegistration.
*
* @param The strategy type.
*
* @author Steve Ebersole
*/
public class SimpleStrategyRegistrationImpl implements StrategyRegistration {
private final Class strategyRole;
private final Class strategyImplementation;
private final Iterable selectorNames;
/**
* Constructs a SimpleStrategyRegistrationImpl.
*
* @param strategyRole The strategy contract
* @param strategyImplementation The strategy implementation class
* @param selectorNames The selection/registration names for this implementation
*/
public SimpleStrategyRegistrationImpl(
Class strategyRole,
Class strategyImplementation,
Iterable selectorNames) {
this.strategyRole = strategyRole;
this.strategyImplementation = strategyImplementation;
this.selectorNames = selectorNames;
}
/**
* Constructs a SimpleStrategyRegistrationImpl.
*
* @param strategyRole The strategy contract
* @param strategyImplementation The strategy implementation class
* @param selectorNames The selection/registration names for this implementation
*/
public SimpleStrategyRegistrationImpl(
Class strategyRole,
Class strategyImplementation,
String... selectorNames) {
this( strategyRole, strategyImplementation, Arrays.asList( selectorNames ) );
}
@Override
public Class getStrategyRole() {
return strategyRole;
}
@Override
public Iterable getSelectorNames() {
return selectorNames;
}
@Override
public Class getStrategyImplementation() {
return strategyImplementation;
}
}