Class ContentMapping

  • All Implemented Interfaces:
    ContentFilter, ExtensionPoint

    @Immutable
    @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
    public class ContentMapping
    extends Object
    implements ContentFilter
    Represents a mapping from some original string to a replacement. Useful both as an individual ContentFilter as well as a persistable class for consistent anonymization mappings.
    Since:
    TODO
    See Also:
    ContentMappings
    • Method Detail

      • of

        public static ContentMapping of​(@NonNull
                                        String original,
                                        @NonNull
                                        String replacement)
        Constructs a ContentMapping using an original and replacement value.
      • getOriginal

        @NonNull
        public String getOriginal()
        Returns:
        the original string to replace
      • getReplacement

        @NonNull
        public String getReplacement()
        Returns:
        the replacement string that the originals are replaced with
      • filter

        @NonNull
        public String filter​(@NonNull
                             String input)
        Description copied from interface: ContentFilter
        Filters a line or snippet of text.
        Specified by:
        filter in interface ContentFilter
        Parameters:
        input - input data to filter
        Returns:
        the filtered input data
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object