public class MiscUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DISCORD_EPOCH |
static long |
TIMESTAMP_OFFSET |
Constructor and Description |
---|
MiscUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
appendTo(java.util.Formatter formatter,
int width,
int precision,
boolean leftJustified,
java.lang.String out)
Can be used to append a String to a formatter.
|
static java.time.OffsetDateTime |
getCreationTime(java.lang.Object entity)
Gets the creation-time of a JDA-entity by doing the reverse snowflake algorithm on its id.
|
static java.time.OffsetDateTime |
getCreationTime(java.lang.String entityId)
Gets the creation-time of a JDA-entity by doing the reverse snowflake algorithm on its id.
|
static java.lang.String |
getDateTimeString(java.time.OffsetDateTime time)
Returns a prettier String-representation of a OffsetDateTime object
|
public static final long DISCORD_EPOCH
public static final long TIMESTAMP_OFFSET
public static java.time.OffsetDateTime getCreationTime(java.lang.String entityId)
entityId
- The id of the JDA entity where the creation-time should be determined forpublic static java.time.OffsetDateTime getCreationTime(java.lang.Object entity)
entity
- The JDA entity where the creation-time should be determined forpublic static java.lang.String getDateTimeString(java.time.OffsetDateTime time)
time
- The OffsetDateTime object to formatpublic static void appendTo(java.util.Formatter formatter, int width, int precision, boolean leftJustified, java.lang.String out)
formatter
- The Formatter
width
- Minimum width to meet, filled with space if neededprecision
- Maximum amount of characters to appendleftJustified
- Whether or not to left-justify the valueout
- The String to append