Package org.approvej.database.jdbc
Record Class ColumnValueScrubber
java.lang.Object
java.lang.Record
org.approvej.database.jdbc.ColumnValueScrubber
- Record Components:
columnName- the name of the column to be scrubbedreplacement- the replacement function for the column values
- All Implemented Interfaces:
Function<QueryResult,,QueryResult> UnaryOperator<QueryResult>,org.approvej.scrub.Scrubber<ColumnValueScrubber,QueryResult, String>
@NullMarked
public record ColumnValueScrubber(String columnName, org.approvej.scrub.Replacement<String> replacement)
extends Record
implements org.approvej.scrub.Scrubber<ColumnValueScrubber,QueryResult,String>
A
Scrubber for QueryResults that replaces all values in a specific column.
By default, a column "my_column" will be replaced with "[my_column]". This can be changed via
replacement(Replacement).
-
Constructor Summary
ConstructorsConstructorDescriptionColumnValueScrubber(String columnName) Creates aScrubberfor the given columnName with the default replacement.ColumnValueScrubber(String columnName, org.approvej.scrub.Replacement<String> replacement) Creates an instance of aColumnValueScrubberrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapply(QueryResult result) Returns the value of thecolumnNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.approvej.scrub.Replacement<String> Returns the value of thereplacementrecord component.replacement(org.approvej.scrub.Replacement<String> replacement) final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.approvej.scrub.Scrubber
replacement
-
Constructor Details
-
ColumnValueScrubber
Creates aScrubberfor the given columnName with the default replacement.- Parameters:
columnName- the name of the column to be scrubbed
-
ColumnValueScrubber
Creates an instance of aColumnValueScrubberrecord class.- Parameters:
columnName- the value for thecolumnNamerecord componentreplacement- the value for thereplacementrecord component
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<QueryResult,QueryResult>
-
replacement
- Specified by:
replacementin interfaceorg.approvej.scrub.Scrubber<ColumnValueScrubber,QueryResult, String>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
columnName
Returns the value of thecolumnNamerecord component.- Returns:
- the value of the
columnNamerecord component
-
replacement
Returns the value of thereplacementrecord component.- Returns:
- the value of the
replacementrecord component
-