Skip to content

Commit

Permalink
Merge pull request #545 from KILLEliteMaste/server
Browse files Browse the repository at this point in the history
Adding missing server fields to Server and ServerUpdater
  • Loading branch information
Bastian committed May 10, 2020
2 parents 3b10a83 + c07f0bf commit d502d7f
Show file tree
Hide file tree
Showing 37 changed files with 2,225 additions and 39 deletions.
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();

}
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;
}
}

0 comments on commit d502d7f

Please sign in to comment.