public class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_DEBUG_PACKET_COUNT |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static <U> CompletableFuture<U> |
failedFuture(Throwable ex)
Returns a new CompletableFuture that is already completed exceptionally with the given
exception.
|
static Set<Class<?>> |
getGeneratedClassesForAnnotation(Class<? extends Annotation> annotationClass)
Returns a set of all the classes that are annotated by a given annotation.
|
static Set<Class<?>> |
getGeneratedClassesForAnnotation(String input)
Returns a set of all the classes that are annotated by a given annotation.
|
static UUID |
getJavaUuid(long xuid) |
static UUID |
getJavaUuid(String xuid) |
static String |
getLocale(Locale locale) |
static String |
getStackTrace(Throwable throwable) |
static boolean |
isUniquePrefix(String prefix) |
static boolean |
isValidDatabaseName(String databaseName) |
static Properties |
readProperties(String resourceFile)
Reads a properties resource file
|
static void |
removeHandler(io.netty.channel.ChannelPipeline pipeline,
String handler)
This method is used in Addons.
Most addons can be removed once the player associated to the channel has been logged in, but they should also be removed once the inject is removed. |
public static final int MAX_DEBUG_PACKET_COUNT
public static void removeHandler(io.netty.channel.ChannelPipeline pipeline,
String handler)
pipeline - the pipelinehandler - the name of the handler to removepublic static Properties readProperties(String resourceFile)
resourceFile - the resource file to readAssertionError - if something went wrong while readin the resource filepublic static UUID getJavaUuid(long xuid)
public static boolean isUniquePrefix(String prefix)
public static boolean isValidDatabaseName(String databaseName)
public static <U> CompletableFuture<U> failedFuture(Throwable ex)
U - the type of the valueex - the exceptionpublic static Set<Class<?>> getGeneratedClassesForAnnotation(Class<? extends Annotation> annotationClass)
annotationClass - the annotation classpublic static Set<Class<?>> getGeneratedClassesForAnnotation(String input)
input - the fully qualified name of the annotation