- java.lang.Object
-
- dev.netcode.util.Utils
-
public class Utils extends java.lang.ObjectThis class contains some different functions so that you dont need to implement them
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetCaller()This function returns the name of the class that contained the function that called this function (think about it. it makes sense).static java.lang.StringgetCaller(int offset)This function returns the name of the class that contained the function that called this function (think about it. it makes sense).static java.lang.StringgetDate()static java.lang.StringgetTime()
-
-
-
Method Detail
-
getTime
public static java.lang.String getTime()
- Returns:
- current time in HH:mm:ss format (e.g. 17:59:38)
-
getDate
public static java.lang.String getDate()
- Returns:
- current date in d.MM.YYYY format (e.g. 21.01.2021)
-
getCaller
public static java.lang.String getCaller() throws java.lang.ClassNotFoundExceptionThis function returns the name of the class that contained the function that called this function (think about it. it makes sense). That way you can find out which class called a specific function.- Returns:
- the caller of the function that called this function
- Throws:
java.lang.ClassNotFoundException- shouldn't really be thrown
-
getCaller
public static java.lang.String getCaller(int offset) throws java.lang.ClassNotFoundExceptionThis function returns the name of the class that contained the function that called this function (think about it. it makes sense). That way you can find out which class called a specific function.- Parameters:
offset- to add to the stack trace if it was passed through any other class- Returns:
- the name of the calling class
- Throws:
java.lang.ClassNotFoundException- shouldn't really be thrown
-
-