|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.common.utils.IdUtils
public final class IdUtils
Utils for identifier generation.
Field Summary | |
---|---|
static Pattern |
STUPID_REGEXP
|
Method Summary | |
---|---|
static String |
generateId(String s)
Deprecated. use generatePathSegment(java.lang.String) instead, or
generateId(String, String, boolean, int) depending
on the use cases |
static String |
generateId(String s,
String wordSeparator,
boolean lower,
int maxChars)
Generates an id from a non-null String. |
static long |
generateLongId()
Generates an unique long identifier. |
static String |
generatePathSegment(String s)
Deprecated. use PathSegmentService instead |
static String |
generateStringId()
Generates an unique string identifier. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Pattern STUPID_REGEXP
Method Detail |
---|
public static String generateStringId()
public static long generateLongId()
public static String generateId(String s, String wordSeparator, boolean lower, int maxChars)
Replaces accented characters from a string by their ascii equivalent, removes non alphanumerical characters and replaces spaces by the given wordSeparator character.
s
- the original StringwordSeparator
- the word separator to use (usually '-')lower
- if lower is true, remove upper casemaxChars
- maximum longer of identifier characters
@Deprecated public static String generateId(String s)
generatePathSegment(java.lang.String)
instead, or
generateId(String, String, boolean, int)
depending
on the use cases
Uses default values for wordSeparator: '-', lower: true, maxChars: 24.
@Deprecated public static String generatePathSegment(String s)
PathSegmentService
instead
Basically all characters are kept, except for slashes and initial/trailing spaces.
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |