Package com.jeff_media.updatechecker
Class UserAgentBuilder
java.lang.Object
com.jeff_media.updatechecker.UserAgentBuilder
Creates a User-Agent string. Always starts with "JEFF-Media-GbR-SpigotUpdateChecker/[version]" followed by all added parameters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds the Bukkit version.addKeyValue
(String key, String value) Adds a custom Key/Value string.addPlaintext
(String text) Adds a custom string.Adds the plugin and version.Adds the Server version.Returns the Spigot User ID of the user who downloaded the plugin.Returns whether this copy of the .jar is a paid plugin downloaded from SpigotMC.org.protected String
build()
Converts this UserAgentBuilder instance to a UserAgent stringstatic UserAgentBuilder
Returns the default User-Agent, consisting of Plugin name and version, Server version and Bukkit version
-
Constructor Details
-
UserAgentBuilder
public UserAgentBuilder()
-
-
Method Details
-
getDefaultUserAgent
Returns the default User-Agent, consisting of Plugin name and version, Server version and Bukkit version- Returns:
- UserAgentBuilder instance
-
addBukkitVersion
Adds the Bukkit version. For example "BukkitVersion/1.16.5-R0.1-SNAPSHOT"- Returns:
- UserAgentBuilder instance
-
addKeyValue
Adds a custom Key/Value string. For example "foo/bar"- Parameters:
key
- Keyvalue
- Value- Returns:
- UserAgentBuilder instance
-
addPlaintext
Adds a custom string. For example "foo"- Parameters:
text
- Custom string- Returns:
- UserAgentBuilder instance
-
addPluginNameAndVersion
Adds the plugin and version. For example "AngelChest/3.11.0"- Returns:
- UserAgentBuilder instance
-
addServerVersion
Adds the Server version. For example "ServerVersion/git-Paper-584 (MC: 1.16.5)"- Returns:
- UserAgentBuilder instance
-
addSpigotUserId
Returns the Spigot User ID of the user who downloaded the plugin. Only works for paid plugins from SpigotMC.org. For example "SpigotUID/175238"- Returns:
- UserAgentBuilder instance
-
addUsingPaidVersion
Returns whether this copy of the .jar is a paid plugin downloaded from SpigotMC.org. For example "Paid/true"- Returns:
- UserAgentBuilder instance
-
build
Converts this UserAgentBuilder instance to a UserAgent string- Returns:
- UserAgent string
-