Class LinkManager
java.lang.Object
org.strassburger.serverlinksz.util.LinkManager
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a link to the config and updates the linksvoid
Clears all links from the serverGets a link by keyGets all link keys from the configgetLinkKeys
(Predicate<LinkManager.Link> predicate) Gets all link keys from the config that match the predicatevoid
removeLink
(String key) Removes a link from the config and updates the linksvoid
Updates the links
-
Constructor Details
-
LinkManager
-
-
Method Details
-
updateLinks
public void updateLinks()Updates the links -
addLink
Adds a link to the config and updates the links- Parameters:
key
- The key of the linkname
- The name of the linkurl
- The URL of the linkcommand
- Whether the link should allow commands
-
removeLink
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
Gets a link by key- Parameters:
key
- The key of the link- Returns:
- The link
-
getLinkKeys
Gets all link keys from the config- Returns:
- All link keys
-
getLinkKeys
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
-