Record Class CssSelector.AttributeSelector
java.lang.Object
java.lang.Record
dev.jcputney.mjml.css.CssSelector.AttributeSelector
- Record Components:
attribute- the attribute name to matchoperator- the comparison operator, ornullfor presence-only checksvalue- the value to compare against, ornullwhen operator isnull
- All Implemented Interfaces:
CssSelector, CssSelector.SimpleSelector
- Enclosing interface:
CssSelector
public static record CssSelector.AttributeSelector(String attribute, String operator, String value)
extends Record
implements CssSelector.SimpleSelector
Attribute selector with operator. Operators: null (has attr), "=" (exact), "~=" (word), "|="
(prefix-dash), "^=" (starts-with), "$=" (ends-with), "*=" (contains)
-
Nested Class Summary
Nested classes/interfaces inherited from interface CssSelector
CssSelector.AttributeSelector, CssSelector.ClassSelector, CssSelector.Combinator, CssSelector.ComplexSelector, CssSelector.CompoundSelector, CssSelector.IdSelector, CssSelector.PseudoClassSelector, CssSelector.PseudoElementSelector, CssSelector.SelectorList, CssSelector.SimpleSelector, CssSelector.TypeSelector, CssSelector.UniversalSelector -
Constructor Summary
ConstructorsConstructorDescriptionAttributeSelector(String attribute, String operator, String value) Creates an instance of aAttributeSelectorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.operator()Returns the value of theoperatorrecord component.Computes the specificity of this selector.toString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
specificity
Description copied from interface:CssSelectorComputes the specificity of this selector.- Specified by:
specificityin interfaceCssSelector- Returns:
- the computed specificity for this selector
-
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). -
attribute
-
operator
-
value
-