Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.java.ao.schema;
 
 
 import java.util.Map;
 
 import static com.google.common.base.Preconditions.*;

A table name converter that simply caches the converted table names.

This implementation uses a java.util.concurrent.ConcurrentMap and is thread safe.

Since:
0.9
    private final Map<Class<? extends RawEntity<?>>, Stringcache;
    public CachingTableNameConverter(final TableNameConverter delegateTableNameConverter)
    {
        checkNotNull(delegateTableNameConverter);
        this. = new MapMaker().makeComputingMap(new Function<Class<? extends RawEntity<?>>, String>()
        {
            public String apply(Class<? extends RawEntity<?>> entityClass)
            {
                return delegateTableNameConverter.getName(entityClass);
            }
        });
    }
    public String getName(Class<? extends RawEntity<?>> entityClass)
    {
        return .get(entityClass);
    }
New to GrepCode? Check out our FAQ X