Class LinkString

java.lang.Object
org.apache.juneau.dto.LinkString
All Implemented Interfaces:
Comparable<LinkString>
Direct Known Subclasses:
DirectoryResource.Action, LogsResource.Action

@HtmlLink @Bean(findFluentSetters=true) public class LinkString extends Object implements Comparable<LinkString>
Simple bean that implements a hyperlink for the HTML serializer.

The name and url properties correspond to the following parts of a hyperlink in an HTML document...

<a href='href'>name</a>

When encountered by the HtmlSerializer class, this object gets converted to a hyperlink. All other serializers simply convert it to a simple bean.

See Also:
  • Constructor Details

    • LinkString

      public LinkString()
      No-arg constructor.
    • LinkString

      public LinkString(String name, String uri, Object... uriArgs)
      Constructor.
      Parameters:
      name - Corresponds to the text inside of the <A> element.
      uri - Corresponds to the value of the href attribute of the <A> element.
      uriArgs - Optional arguments for MessageFormat style arguments in the href.
  • Method Details

    • getName

      public String getName()
      Bean property getter: name.

      Corresponds to the text inside of the <A> element.

      Returns:
      The property value, or null if it is not set.
    • setName

      public LinkString setName(String value)
      Bean property setter: name.

      Corresponds to the text inside of the <A> element.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • getUri

      public URI getUri()
      Bean property getter: uri.

      Corresponds to the value of the href attribute of the <A> element.

      Returns:
      The property value, or null if it is not set.
    • setUri

      public LinkString setUri(URI value)
      Bean property setter: uri.

      Corresponds to the value of the href attribute of the <A> element.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object
    • setUri

      public LinkString setUri(String value)
      Bean property fluent setter: uri.

      Corresponds to the value of the href attribute of the <A> element.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      Returns:
      This object.
    • setUri

      public LinkString setUri(String value, Object... args)
      Bean property fluent setter: uri.

      Corresponds to the value of the href attribute of the <A> element.

      Parameters:
      value - The new value for this property.
      Can be null to unset the property.
      args - MessageFormat-style arguments in the URL.
      Returns:
      This object.
    • toString

      public String toString()
      Returns the name so that the ObjectSearcher class can search against it.
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(LinkString o)
      Specified by:
      compareTo in interface Comparable<LinkString>
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object