Class UniqueNameGenerationHelper.NameGenerationOptions

    • Method Detail

      • getMaxLength

        public int getMaxLength()
        Deprecated.
      • getStartIndex

        public int getStartIndex()
        Deprecated.
      • getValidityCheck

        public Predicate<String> getValidityCheck()
        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.
      • 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

        public UniqueNameGenerationHelper.NameGenerationOptions sanitizer​(UnaryOperator<String> 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.
      • copySuffix

        public UniqueNameGenerationHelper.NameGenerationOptions copySuffix​(String 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

        public UniqueNameGenerationHelper.NameGenerationOptions copyWithSpace​(String copyName)
        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.