-
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #545 from KILLEliteMaste/server
Adding missing server fields to Server and ServerUpdater
- Loading branch information
Showing
37 changed files
with
2,225 additions
and
39 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
javacord-api/src/main/java/org/javacord/api/entity/VanityUrlCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.javacord.api.entity; | ||
|
||
import java.net.URL; | ||
|
||
public interface VanityUrlCode { | ||
|
||
/** | ||
* Gets the vanity code. | ||
* | ||
* @return The vanity code. | ||
*/ | ||
String getCode(); | ||
|
||
/** | ||
* Gets the vanity url. | ||
* | ||
* @return The URL of the vanity code. | ||
*/ | ||
URL getUrl(); | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
javacord-api/src/main/java/org/javacord/api/entity/server/BoostLevel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package org.javacord.api.entity.server; | ||
|
||
/** | ||
* An enum with all boost levels (sometimes also referred to as premium tier levels). | ||
*/ | ||
public enum BoostLevel { | ||
|
||
/** | ||
* Server has no boost level. | ||
*/ | ||
NONE(0), | ||
/** | ||
* Server Boost level 1. | ||
*/ | ||
TIER_1(1), | ||
/** | ||
* Server Boost level 2. | ||
*/ | ||
TIER_2(2), | ||
|
||
/** | ||
* Server Boost level 3. | ||
*/ | ||
TIER_3(2), | ||
|
||
/** | ||
* An unknown boost level, most likely due to new added boost levels. | ||
*/ | ||
UNKNOWN(-1); | ||
|
||
|
||
/** | ||
* The id of the boost level. | ||
*/ | ||
private final int id; | ||
|
||
/** | ||
* Creates a new boost level. | ||
* | ||
* @param id The id of the boost level. | ||
*/ | ||
BoostLevel(int id) { | ||
this.id = id; | ||
} | ||
|
||
/** | ||
* Gets the id of the boost level. | ||
* | ||
* @return The id of the boost level. | ||
*/ | ||
public int getId() { | ||
return id; | ||
} | ||
|
||
/** | ||
* Gets the boost level by its id. | ||
* | ||
* @param id The id of the boost level. | ||
* @return The boost level with the given id. | ||
*/ | ||
public static BoostLevel fromId(int id) { | ||
for (BoostLevel boostLevel : values()) { | ||
if (boostLevel.getId() == id) { | ||
return boostLevel; | ||
} | ||
} | ||
return UNKNOWN; | ||
} | ||
} |
Oops, something went wrong.