Class LinkManager

java.lang.Object
org.strassburger.serverlinksz.util.LinkManager

public class LinkManager extends Object
  • Constructor Details

  • Method Details

    • updateLinks

      public void updateLinks()
      Updates the links
    • addLink

      public void addLink(String key, String name, String url, boolean command)
      Adds a link to the config and updates the links
      Parameters:
      key - The key of the link
      name - The name of the link
      url - The URL of the link
      command - Whether the link should allow commands
    • removeLink

      public void removeLink(String key)
      Removes a link from the config and updates the links
      Parameters:
      key - The key of the link
    • clearLinks

      public void clearLinks()
      Clears all links from the server
    • getLink

      @Nullable public LinkManager.Link getLink(String key)
      Gets a link by key
      Parameters:
      key - The key of the link
      Returns:
      The link
    • getLinkKeys

      public Set<String> getLinkKeys()
      Gets all link keys from the config
      Returns:
      All link keys
    • getLinkKeys

      public Set<String> getLinkKeys(Predicate<LinkManager.Link> predicate)
      Gets all link keys from the config that match the predicate
      Parameters:
      predicate - The predicate to match
      Returns:
      All link keys that match the predicate