Package com.helger.base.id.factory
Class StringIDFactory
java.lang.Object
com.helger.base.id.factory.StringIDFactory
- All Implemented Interfaces:
IBaseIDFactory,IIDFactory<String>,IStringIDFactory
- Direct Known Subclasses:
StringIDFromGlobalIntIDFactory,StringIDFromGlobalLongIDFactory,StringIDFromGlobalPersistentIntIDFactory,StringIDFromGlobalPersistentLongIDFactory,StringIDFromIntIDFactory,StringIDFromLongIDFactory
An
IStringIDFactory implementation that uses a constant prefix and an
int supplied from GlobalIDFactory.getNewIntID() to create unique IDs.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionStringIDFactory(@NonNull IStringIDFactory aBaseFactory) Constructor using the default prefix.StringIDFactory(@NonNull String sPrefix, @NonNull IStringIDFactory aBaseFactory) Constructor with a custom prefix. -
Method Summary
-
Constructor Details
-
StringIDFactory
Constructor using the default prefix.- Parameters:
aBaseFactory- The base string ID factory to use. May not benull.
-
StringIDFactory
Constructor with a custom prefix.- Parameters:
sPrefix- The prefix to prepend to each generated ID. May not benull.aBaseFactory- The base string ID factory to use. May not benull.
-
-
Method Details
-
getPrefix
- Returns:
- The prefix used for all generated IDs. Never
null.
-
getNewID
- Specified by:
getNewIDin interfaceIIDFactory<String>- Returns:
- The new unique ID. May never be
null.
-
equals
-
hashCode
public int hashCode() -
toString
-