Class ContentMapping
- java.lang.Object
-
- com.cloudbees.jenkins.support.filter.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from interface com.cloudbees.jenkins.support.filter.ContentFilter
ALL
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
filter(String input)
Filters a line or snippet of text.String
getOriginal()
String
getReplacement()
int
hashCode()
static ContentMapping
of(String original, String replacement)
Constructs a ContentMapping using an original and replacement value.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.cloudbees.jenkins.support.filter.ContentFilter
ensureLoaded, reload
-
-
-
-
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 interfaceContentFilter
- Parameters:
input
- input data to filter- Returns:
- the filtered input data
-
-