Watchmaker Framework API
(Version 0.6.2)

org.uncommons.util.id
Class StringPrefixIDSource

java.lang.Object
  extended by org.uncommons.util.id.StringPrefixIDSource
All Implemented Interfaces:
IDSource<String>

public class StringPrefixIDSource
extends Object
implements IDSource<String>

Thread-safe ID source that wraps another source of IDs and adds a fixed String prefix to each ID generated.

Author:
Daniel Dyer

Constructor Summary
StringPrefixIDSource(String prefix, IDSource<?> source)
           
 
Method Summary
 String nextID()
          Implementing classes are responsible for synchronization if concurrent invocations of this method are required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringPrefixIDSource

public StringPrefixIDSource(String prefix,
                            IDSource<?> source)
Parameters:
prefix - A fixed String that is attached to the front of each ID.
source - The source of IDs to which the prefix is added.
Method Detail

nextID

public String nextID()
Implementing classes are responsible for synchronization if concurrent invocations of this method are required.

Specified by:
nextID in interface IDSource<String>
Returns:
The next ID.

Watchmaker Framework API
(Version 0.6.2)