Class Anchor

java.lang.Object
com.attribyte.parser.model.Anchor

public class Anchor extends Object
An immutable anchor element.
Author:
Matt Hamer
  • Field Details

    • href

      public final String href
      The href attribute.
    • title

      public final String title
      The title attribute.
    • anchorText

      public final String anchorText
      The anchor text.
  • Constructor Details

    • Anchor

      public Anchor(String href, String title, String anchorText)
      Creates an anchor.
      • Null values converted to empty string
      • Values trimmed
      Parameters:
      href - The href.
      title - The title.
      anchorText - The anchor text (text content of 'a' element).
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • matchesDomain

      public boolean matchesDomain(com.google.common.net.InternetDomainName checkDomain)
      Determine if the domain name for the href matches a specified domain name.
      Parameters:
      checkDomain - The domain to check.
      Returns:
      Does the domain match?