Package yapion.utils
Class ReferenceIDUtils
- java.lang.Object
-
- yapion.utils.ReferenceIDUtils
-
public class ReferenceIDUtils extends java.lang.Object
-
-
Method Summary
Modifier and Type Method Description static long
calc(java.lang.String s)
Calculates the reference ID of a given String, primarily used for variable names.static void
discardCache()
Discard the cache used bycalc(String)
static java.lang.String
format(long l)
Formats the input to the standard reference ID structure.static void
setCacheSize(int cacheSize)
Set the cache size of the internal cache to a specific number above 100.
-
-
-
Method Detail
-
calc
public static long calc(java.lang.String s)
Calculates the reference ID of a given String, primarily used for variable names. This method caches the last 100 inputs for faster reference ID calculation. UsediscardCache()
to discard this Cache.- Parameters:
s
- the input string to calculate a reference ID from- Returns:
- the reference ID of the given String
-
setCacheSize
public static void setCacheSize(int cacheSize)
Set the cache size of the internal cache to a specific number above 100. If you set a number below 100 it will default to 100.- Parameters:
cacheSize
- the cache Size
-
discardCache
public static void discardCache()
Discard the cache used bycalc(String)
-
format
public static java.lang.String format(long l)
Formats the input to the standard reference ID structure.- Parameters:
l
- the input to format- Returns:
- the formatted input
-
-