Class UniqueNameGenerationHelper.NameGenerationOptions

java.lang.Object
de.xima.fc.copy.UniqueNameGenerationHelper.NameGenerationOptions
Enclosing class:
UniqueNameGenerationHelper

@Deprecated public static class UniqueNameGenerationHelper.NameGenerationOptions extends Object
POJO for customizing the options
Since:
8.3.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • getMaxLength

      public int getMaxLength()
      Deprecated.
    • getStartIndex

      public int getStartIndex()
      Deprecated.
    • getValidityCheck

      public Predicate<String> getValidityCheck()
      Deprecated.
    • getSanitizer

      public UnaryOperator<String> getSanitizer()
      Deprecated.
    • getInterpolator

      public BiFunction<String,Integer,String> getInterpolator()
      Deprecated.
    • getMaxAttempts

      public int getMaxAttempts()
      Deprecated.
    • maxLength

      public UniqueNameGenerationHelper.NameGenerationOptions maxLength(int maxLength)
      Deprecated.
      Parameters:
      maxLength - Maximum length that is allowed for the name. The generated name is truncated to fit this length.
      Returns:
      This for chaining.
    • maxAttempts

      public UniqueNameGenerationHelper.NameGenerationOptions maxAttempts(int maxAttempts)
      Deprecated.
      Parameters:
      maxAttempts - Maximum number of generated names that are tried (against getValidityCheck()).
      Returns:
      This for chaining.
    • startIndex

      public UniqueNameGenerationHelper.NameGenerationOptions startIndex(int startIndex)
      Deprecated.
      Parameters:
      startIndex - The initial index used for generating new names. Defaults to 1, so the first generated name ends on Copy_1.
      Returns:
      This for chaining.
    • validityCheck

      public UniqueNameGenerationHelper.NameGenerationOptions validityCheck(Predicate<String> validityCheck)
      Deprecated.
      Parameters:
      validityCheck - A predicate that checks whether a given generated name is allowed, eg. whether a project with that name exists already. It must return true if the given new name is valid, false otherwise.
      Returns:
      This for chaining.
    • sanitizer

      Deprecated.
      Parameters:
      sanitizer - An operator that takes a generated name and sanitizes it, eg. replaces characters that are not allowed for that name, such as whitespaces with underscores.
      Returns:
      This for chaining.
    • interpolator

      Deprecated.
      Parameters:
      interpolator - Function that receives the name and the current index and creates the derived name with the index, eg myfile (copy 2).
    • copySuffix

      Deprecated.
      Setup the interpolator so that the generated names are like MyEntity_Copy_4
      Parameters:
      copySuffix - Suffix added to the original name, eg. Copy.
      Returns:
      This for chaining.
    • copyWithSpace

      Deprecated.
      Setup the interpolator so that the generated names are like MyEntity (Copy 4)
      Parameters:
      copyName - Localized name for 'Copy'.
      Returns:
      This for chaining.
    • replace

      public UniqueNameGenerationHelper.NameGenerationOptions replace(String disallowedCharactersRegex, char replacementCharacter)
      Deprecated.
      When generating the new name, replaces all matches for the given regex with the given replacement. Useful eg. for replacing whitespaces with underscores.
      Parameters:
      disallowedCharactersRegex - Characters that are not allowed in the name and should be replaced.
      replacementCharacter - Character that replaces the disallowed characters.
      Returns:
      This for chaining.
    • create

      Deprecated.