Record Class BooleanAbstraction.Replacement
java.lang.Object
java.lang.Record
org.variantsync.diffdetective.feature.BooleanAbstraction.Replacement
- Enclosing class:
BooleanAbstraction
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
Replacement
(Pattern pattern, String replacement) Creates an instance of aReplacement
record class. -
Method Summary
Modifier and TypeMethodDescriptionReplaces all patterns found invalue
by its replacement.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Creates a new replacement matchingoriginal
literally.onlyFullWord
(String original, String replacement) Creates a new replacement matchingoriginal
literally but only on word boundaries.pattern()
Returns the value of thepattern
record component.Returns the value of thereplacement
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
pattern
The field for thepattern
record component. -
replacement
The field for thereplacement
record component.
-
-
Constructor Details
-
Replacement
Creates an instance of aReplacement
record class.- Parameters:
pattern
- the value for thepattern
record componentreplacement
- the value for thereplacement
record component
-
-
Method Details
-
literal
Creates a new replacement matchingoriginal
literally.- Parameters:
original
- a string which is searched for literally (without any special characters)replacement
- the literal replacement for strings matched byoriginal
-
onlyFullWord
Creates a new replacement matchingoriginal
literally but only on word boundaries.A word boundary is defined as the transition from a word character (alphanumerical characters) to a non-word character (everything else) or the transition from any character to a bracket (the characters
(
and)
).- Parameters:
original
- a string which is searched for as a whole word literally (without any special characters)replacement
- the literal replacement for strings matched byoriginal
-
applyTo
Replaces all patterns found invalue
by its replacement. -
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)
. -
pattern
Returns the value of thepattern
record component.- Returns:
- the value of the
pattern
record component
-
replacement
Returns the value of thereplacement
record component.- Returns:
- the value of the
replacement
record component
-