public class UniqueNameGenerationHelper extends Object
Modifier and Type | Class and Description |
---|---|
static class |
UniqueNameGenerationHelper.NameGenerationOptions
POJO for customizing the options of
EntityUtils#generateNewName(String, NameGenerationOptions) |
Constructor and Description |
---|
UniqueNameGenerationHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
generateNewName(String originalName,
UniqueNameGenerationHelper.NameGenerationOptions options)
Sometimes a new name needs to be generated for an entity, but not all names are allowed.
|
public static final String generateNewName(String originalName, UniqueNameGenerationHelper.NameGenerationOptions options) throws LimitExceededException
My Project_Copy_9
.originalName
- Original name.lengthLimit
- Maximum length that is allowed for the name.validityCheck
- A predicate that checks whether a given generated name is allowed, eg. whether a project with
that name exists already.LimitExceededException
- When no new unique name could be generated.Copyright © 2019 XIMA MEDIA GmbH. All rights reserved.