Package proguard.util

Class PrefixRemovingStringFunction

  • All Implemented Interfaces:
    StringFunction

    public class PrefixRemovingStringFunction
    extends java.lang.Object
    implements StringFunction
    This StringFunction removes a given prefix from each transformed String, if present.
    • Constructor Detail

      • PrefixRemovingStringFunction

        public PrefixRemovingStringFunction​(java.lang.String prefix)
        Creates a new PrefixRemovingStringFunction.
        Parameters:
        prefix - the prefix to remove from each string.
      • PrefixRemovingStringFunction

        public PrefixRemovingStringFunction​(java.lang.String prefix,
                                            StringFunction stringFunction)
        Creates a new PrefixRemovingStringFunction.
        Parameters:
        prefix - the prefix to remove from each string.
        stringFunction - the function to subsequently apply to all strings.
      • PrefixRemovingStringFunction

        public PrefixRemovingStringFunction​(java.lang.String prefix,
                                            StringFunction successStringFunction,
                                            StringFunction failStringFunction)
        Creates a new PrefixRemovingStringFunction.
        Parameters:
        prefix - the prefix to remove from each string.
        successStringFunction - the function to subsequently apply to prefixed strings.
        failStringFunction - the function to subsequently apply to other strings.
    • Method Detail

      • transform

        public java.lang.String transform​(java.lang.String string)
        Description copied from interface: StringFunction
        Transforms the given string into a new string.
        Specified by:
        transform in interface StringFunction