Package de.xima.fc.copy
Class UniqueNameGenerationHelper
- java.lang.Object
-
- de.xima.fc.copy.UniqueNameGenerationHelper
-
public class UniqueNameGenerationHelper extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UniqueNameGenerationHelper.NameGenerationOptions
POJO for customizing the options
-
Constructor Summary
Constructors Constructor Description UniqueNameGenerationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
generateNewName
public static final String generateNewName(String originalName, UniqueNameGenerationHelper.NameGenerationOptions options) throws LimitExceededException
Sometimes a new name needs to be generated for an entity, but not all names are allowed. This method generates new names with an index and returns the first name it finds that passes the given validity check. May be used, for example, to create a new name for a copied project, eg.My Project_Copy_9
.- Parameters:
originalName
- Original name.options
- options for generating the new name- Returns:
- A new name that passes the validity check.
- Throws:
LimitExceededException
- When no new unique name could be generated.
-
-