Interface ServerLinks


public interface ServerLinks
Represents a collections of links which may be sent to a client.
Since:
1.21
  • Method Details

    • getLink

      @Nullable @Nullable ServerLinks.ServerLink getLink(@NotNull @NotNull ServerLinks.Type type)
      Gets the link of a given type, if it exists.
      Parameters:
      type - link type
      Returns:
      link or null
      Since:
      1.21
    • getLinks

      @NotNull @NotNull List<ServerLinks.ServerLink> getLinks()
      Gets an immutable list of all links.
      Returns:
      immutable list
      Since:
      1.21
    • setLink

      @NotNull @NotNull ServerLinks.ServerLink setLink(@NotNull @NotNull ServerLinks.Type type, @NotNull @NotNull URI url)
      Adds the given link, overwriting the first link of the same type if already set.
      Parameters:
      type - link type
      url - link url
      Returns:
      the added link
      Since:
      1.21
    • addLink

      @NotNull @NotNull ServerLinks.ServerLink addLink(@NotNull @NotNull ServerLinks.Type type, @NotNull @NotNull URI url)
      Adds the given link to the list of links.
      Parameters:
      type - link type
      url - link url
      Returns:
      the added link
      Since:
      1.21
    • addLink

      @NotNull @NotNull ServerLinks.ServerLink addLink(@NotNull net.kyori.adventure.text.Component displayName, @NotNull @NotNull URI url)
      Adds the given link to the list of links.
      Parameters:
      displayName - link name / display text Component
      url - link url
      Returns:
      the added link
      Since:
      1.21
    • addLink

      @Deprecated @NotNull @NotNull ServerLinks.ServerLink addLink(@NotNull @NotNull String displayName, @NotNull @NotNull URI url)
      Adds the given link to the list of links.
      Parameters:
      displayName - link name / display text
      url - link url
      Returns:
      the added link
      Since:
      1.21
    • removeLink

      boolean removeLink(@NotNull @NotNull ServerLinks.ServerLink link)
      Removes the given link.
      Parameters:
      link - the link to remove
      Returns:
      if the link existed and was removed
      Since:
      1.21
    • copy

      @NotNull @NotNull ServerLinks copy()
      Returns a copy of this link collection, unassociated from the server.
      Returns:
      copied links
      Since:
      1.21