public abstract class

AbstractIDGenerator

extends Object
implements IDGenerator
java.lang.Object
   ↳ org.apache.commons.betwixt.io.id.AbstractIDGenerator
Known Direct Subclasses

Class Overview

Abstract superclass for IDGenerator implementations.

It implements the entire IDGenerator interface. When nextId is called, this class sets the LastId property (as well as returning the value). Subclasses should override nextIdImpl().

Summary

Public Constructors
AbstractIDGenerator()
Public Methods
final String getLastId()
Gets last ID returned.
final String nextId()

Generate next ID.

Protected Methods
abstract String nextIdImpl()
Subclasses should provide an implementation for this method.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.commons.betwixt.io.IDGenerator

Public Constructors

public AbstractIDGenerator ()

Public Methods

public final String getLastId ()

Gets last ID returned.

Returns
  • the last id created by the generated

public final String nextId ()

Generate next ID.

This method obtains the next ID from subclass and then uses this to set the LastId property.

Returns
  • the next id generated

Protected Methods

protected abstract String nextIdImpl ()

Subclasses should provide an implementation for this method. This implementation needs only provide the next ID value (according to it's algorithm). Setting the LastId property can be left to this class.

Returns
  • the next id generated