org.loom.addons.id.IdGeneratorService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of loom-addons Show documentation
Show all versions of loom-addons Show documentation
Uploads all artifacts belonging to configuration ':archives'.
The newest version!
package org.loom.addons.id;
/**
* Generates public IDs to be used in RESTful URLs
* @author icoloma
*
*/
public interface IdGeneratorService {
/**
* Generate a valid public ID to use for RESTful URIs.
* This method will take the proposed text and calculate a public ID to use in RESTful URIs,
* e.g:
*
* - "Some text" -> "some-text"
* - "[email protected]" -> "abc"
*
* If a candidate already exists in the database it will get appended an index, so
* "some-text" will become "some-text-1", etc.
*
* @param persistentClass the persistent class to generate the public ID for
* @param idFieldName the name of the persistent field that will store the key
* @param keyText the text used to calculate the key
* @return the generated key
*/
public String generateId(Class> persistentClass, String idFieldName, String keyText);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy