javax.ws.rs.core

Interface Link.Builder

  • Enclosing class:
    Link

    public static interface Link.Builder
    Builder class for hypermedia links.
    Since:
    2.0
    See Also:
    Link
    • Method Detail

      • Link.Builder link(Link link)
        Initialize builder using another link. Sets underlying URI and copies all parameters.
        Parameters:
        link - other link from which to initialize.
        Returns:
        the updated builder.
      • Link.Builder link(String link)
        Initialize builder using another link represented as a string. Uses simple parser to convert string representation into a link.
         link ::= '<' uri '>' (';' link-param)*
         link-param ::= name '=' quoted-string
         
        See RFC 5988 for more information.
        Parameters:
        link - other link in string representation.
        Returns:
        the updated builder.
        Throws:
        IllegalArgumentException - if string representation of URI is invalid.
      • uri

        Link.Builder uri(URI uri)
        Set underlying URI template for the link being constructed.
        Parameters:
        uri - underlying URI for link
        Returns:
        the updated builder.
      • uri

        Link.Builder uri(String uri)
        Set underlying string representing URI template for the link being constructed.
        Parameters:
        uri - underlying URI for link.
        Returns:
        the updated builder.
        Throws:
        IllegalArgumentException - if string representation of URI is invalid.
      • uriBuilder

        Link.Builder uriBuilder(UriBuilder uriBuilder)
        Set underlying URI builder representing the URI template for the link being constructed.
        Parameters:
        uriBuilder - underlying URI builder.
        Returns:
        the updated builder.
      • rel

        Link.Builder rel(String rel)
        Convenience method to set a link relation. More than one rel value can be specified by using one or more whitespace characters as delimiters according to RFC 5988. The effect of calling this method is cumulative; relations are appended using a single space character as separator.
        Parameters:
        rel - relation name.
        Returns:
        the updated builder.
        Throws:
        IllegalArgumentException - if the name is null.
      • title

        Link.Builder title(String title)
        Convenience method to set a title on this link.
        Parameters:
        title - title parameter of this link.
        Returns:
        the updated builder.
        Throws:
        IllegalArgumentException - if the title is null.
      • type

        Link.Builder type(String type)
        Convenience method to set a type on this link.
        Parameters:
        type - type parameter of this link.
        Returns:
        the updated builder.
        Throws:
        IllegalArgumentException - if the type is null.
      • param

        Link.Builder param(String name,
                           String value)
        Set an arbitrary parameter on this link. Note that link parameters are those defined in RFC 5988 and should not be confused with URI parameters which can be specified when calling build(Object...).
        Parameters:
        name - the name of the parameter.
        value - the value set for the parameter.
        Returns:
        the updated builder.
        Throws:
        IllegalArgumentException - if either the name or value are null.
      • build

        Link build(Object... values)
        Finish building this link using the supplied values as URI parameters. The state of the builder is unaffected; this method may be called multiple times on the same builder instance.
        Parameters:
        values - parameters used to build underlying URI.
        Returns:
        newly built link.
        Throws:
        IllegalArgumentException - if there are any URI template parameters without a supplied value, or if a value is null.
        UriBuilderException - if a URI cannot be constructed based on the current state of the underlying URI builder.
      • buildRelativized

        Link buildRelativized(URI uri,
                              Object... values)
        Finish building this link using the supplied values as URI parameters and relativize the result with respect to the supplied URI. If the underlying link is already relative or if it is absolute but does not share a prefix with the supplied URI, this method is equivalent to calling build(java.lang.Object[]). Note that a base URI can be set on a relative link using baseUri(java.net.URI). The state of the builder is unaffected; this method may be called multiple times on the same builder instance.
        Parameters:
        uri - URI used for relativization.
        values - parameters used to build underlying URI.
        Returns:
        newly built link.
        Throws:
        IllegalArgumentException - if there are any URI template parameters without a supplied value, or if a value is null.
        UriBuilderException - if a URI cannot be constructed based on the current state of the underlying URI builder.
        See Also:
        baseUri(java.lang.String), baseUri(java.net.URI)

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/ws/rs/core/link.builder.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.