Package yapion.utils
Class ReferenceIDUtils
- java.lang.Object
-
- yapion.utils.ReferenceIDUtils
-
public class ReferenceIDUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static ReferenceFunctionREFERENCE_FUNCTIONCalculates the reference ID of a given String, primarily used for variable names.static ReferenceFunctionREFERENCE_FUNCTION_OLDDeprecated.since 0.23.0
-
Method Summary
Modifier and Type Method Description static voiddiscardCache()Discard the cache used byreferenceOld(String)static java.lang.Stringformat(long l)Formats the input to the standard reference ID structure.static voidsetCacheSize(int cacheSize)Set the cache size of the internal cache to a specific number above 100.
-
-
-
Field Detail
-
REFERENCE_FUNCTION
public static final ReferenceFunction REFERENCE_FUNCTION
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.
-
REFERENCE_FUNCTION_OLD
@Deprecated public static final ReferenceFunction REFERENCE_FUNCTION_OLD
Deprecated.since 0.23.0Calculates 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.
-
-
Method Detail
-
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 byreferenceOld(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
-
-