Class Link

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

public class Link extends Object
An immutable link element.
Author:
Matt Hamer
  • Field Details

    • href

      public final String href
      The href attribute.
    • rel

      public final String rel
      The relation attribute.
    • type

      public final String type
      The link type.
    • title

      public final String title
      The link title.
  • Constructor Details

    • Link

      public Link(String href)
      Creates a link with just an href.
      Parameters:
      href - The href.
    • Link

      public Link(String href, String rel, String type, String title)
      Creates a link.
      • Null values converted to empty string
      • Values trimmed
      Parameters:
      href - The href.
      rel - The relation attribute.
      type - The type attribyte.
      title - The title attribute.
  • 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
    • matchType

      public boolean matchType(String rel, String type)
      Matches the type.
      Parameters:
      rel - The relation. May be null to match any.
      type - The media type. May be null to match any.
      Returns:
      Do the types match?