net.java.ao.atlassian.PrefixedTableNameConverter Maven / Gradle / Ivy
package net.java.ao.atlassian;
import net.java.ao.RawEntity;
import net.java.ao.schema.TableNameConverter;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* A {@link net.java.ao.schema.TableNameConverter table name converter} that will prepend the given {@link Prefix} to table names.
* It uses a {@link net.java.ao.schema.TableNameConverter delegate table name converter} for the general conversion strategy.
*/
final class PrefixedTableNameConverter implements TableNameConverter
{
private final TablePrefix prefix;
/**
* The table name converter we delegate the real conversion to
*/
private final TableNameConverter delegate;
public PrefixedTableNameConverter(TablePrefix prefix, TableNameConverter delegate)
{
this.prefix = checkNotNull(prefix);
this.delegate = checkNotNull(delegate);
}
public String getName(Class extends RawEntity>> clazz)
{
return prefix.prepend(delegate.getName(clazz));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy