Record Class StandardPlaceholder
java.lang.Object
java.lang.Record
pro.verron.officestamper.experimental.StandardPlaceholder
- Record Components:
matcher- the matcher to use for determining if the expression matches.expression- the expression string.
- All Implemented Interfaces:
Placeholder
public record StandardPlaceholder(Matcher matcher, String expression)
extends Record
implements Placeholder
The StandardPlaceholder class represents a placeholder with a specific
matching condition and associated expression.
It uses a
Matcher to determine if the placeholder expression matches
a given prefix and suffix, and to extract the inner content of the placeholder.-
Constructor Summary
ConstructorsConstructorDescriptionStandardPlaceholder(Matcher matcher, String expression) Creates an instance of aStandardPlaceholderrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Retrieves the processed content of the placeholder.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpressionrecord component.final inthashCode()Returns a hash code value for this object.matcher()Returns the value of thematcherrecord component.toString()Returns a string representation of this object.
-
Constructor Details
-
StandardPlaceholder
Creates an instance of aStandardPlaceholderrecord class.- Parameters:
matcher- the value for thematcherrecord componentexpression- the value for theexpressionrecord component
-
-
Method Details
-
content
Retrieves the processed content of the placeholder. If the expression matches the criteria defined by theMatcher, the prefix and suffix are stripped from the expression. Otherwise, the original expression is returned.- Specified by:
contentin interfacePlaceholder- Returns:
- the inner content of the expression if the match criteria are met; otherwise, the complete original expression.
-
toString
-
hashCode
-
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). -
matcher
-
expression
Returns the value of theexpressionrecord component.- Specified by:
expressionin interfacePlaceholder- Returns:
- the value of the
expressionrecord component
-