Package org.trellisldp.api
Class DefaultIdentifierService
- java.lang.Object
-
- org.trellisldp.api.DefaultIdentifierService
-
- All Implemented Interfaces:
IdentifierService
@ApplicationScoped public class DefaultIdentifierService extends Object implements IdentifierService
The IdentifierService provides a mechanism for creating new identifiers.
-
-
Constructor Summary
Constructors Constructor Description DefaultIdentifierService()
Create a UUID-based IdentifierService.DefaultIdentifierService(String prefix)
Create a UUID-based IdentifierService with a default prefix value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Supplier<String>
getSupplier()
Get a Supplier that generates Strings with the provided prefix.Supplier<String>
getSupplier(String prefix)
Get a Supplier that generates Strings with the provided prefix.Supplier<String>
getSupplier(String prefix, int hierarchy, int length)
Get a Supplier that generates Strings with the provided prefix.
-
-
-
Constructor Detail
-
DefaultIdentifierService
public DefaultIdentifierService()
Create a UUID-based IdentifierService.
-
DefaultIdentifierService
public DefaultIdentifierService(String prefix)
Create a UUID-based IdentifierService with a default prefix value.- Parameters:
prefix
- the prefix
-
-
Method Detail
-
getSupplier
public Supplier<String> getSupplier(String prefix, int hierarchy, int length)
Description copied from interface:IdentifierService
Get a Supplier that generates Strings with the provided prefix.- Specified by:
getSupplier
in interfaceIdentifierService
- Parameters:
prefix
- the prefixhierarchy
- the levels of hierarchy to addlength
- the length of each level of hierarchy- Returns:
- a String Supplier
-
getSupplier
public Supplier<String> getSupplier(String prefix)
Description copied from interface:IdentifierService
Get a Supplier that generates Strings with the provided prefix.- Specified by:
getSupplier
in interfaceIdentifierService
- Parameters:
prefix
- the prefix- Returns:
- a String Supplier
-
getSupplier
public Supplier<String> getSupplier()
Description copied from interface:IdentifierService
Get a Supplier that generates Strings with the provided prefix.- Specified by:
getSupplier
in interfaceIdentifierService
- Returns:
- a String Supplier
-
-