org.hibernate.id.enhanced
Class OptimizerFactory.OptimizerSupport

java.lang.Object
  extended by org.hibernate.id.enhanced.OptimizerFactory.OptimizerSupport
All Implemented Interfaces:
Optimizer
Direct Known Subclasses:
OptimizerFactory.HiLoOptimizer, OptimizerFactory.NoopOptimizer, OptimizerFactory.PooledOptimizer
Enclosing class:
OptimizerFactory

public abstract static class OptimizerFactory.OptimizerSupport
extends Object
implements Optimizer

Common support for optimizer implementations.


Field Summary
protected  int incrementSize
           
protected  Class returnClass
           
 
Constructor Summary
protected OptimizerFactory.OptimizerSupport(Class returnClass, int incrementSize)
          Construct an optimizer
 
Method Summary
 int getIncrementSize()
          Retrieves the defined increment size.
 Class getReturnClass()
          Getter for property 'returnClass'.
protected  Serializable make(long value)
          Take the primitive long value and "make" (or wrap) it into the id type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.id.enhanced.Optimizer
applyIncrementSizeToSourceValues, generate, getLastSourceValue
 

Field Detail

returnClass

protected final Class returnClass

incrementSize

protected final int incrementSize
Constructor Detail

OptimizerFactory.OptimizerSupport

protected OptimizerFactory.OptimizerSupport(Class returnClass,
                                            int incrementSize)
Construct an optimizer

Parameters:
returnClass - The expected id class.
incrementSize - The increment size
Method Detail

make

protected final Serializable make(long value)
Take the primitive long value and "make" (or wrap) it into the id type.

Parameters:
value - The primitive value to make/wrap.
Returns:
The wrapped value.

getReturnClass

public final Class getReturnClass()
Getter for property 'returnClass'. This is the Java class which is used to represent the id (e.g. Long).

Returns:
Value for property 'returnClass'.

getIncrementSize

public final int getIncrementSize()
Retrieves the defined increment size.

Specified by:
getIncrementSize in interface Optimizer
Returns:
The increment size.


Copyright © null-null Red Hat Middleware, LLC. All Rights Reserved