Class IdConverterDefinition
java.lang.Object
me.ahoo.cosid.spring.boot.starter.IdConverterDefinition
Configuration definition for ID converters in CosId.
This class defines how IDs should be converted between their internal representation and external string formats. It supports various conversion types including radix conversion, friendly formatting, and custom converters.
Supported converter types:
- TO_STRING - Simple string conversion
- SNOWFLAKE_FRIENDLY - Human-readable snowflake ID format
- RADIX - Base62 radix conversion
- RADIX36 - Base36 radix conversion
- CUSTOM - Custom converter implementation
The configuration also supports prefixes, suffixes, and grouping options to customize the final ID format.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classConfiguration for Radix62 ID converter.static classstatic classstatic enumEnumeration of supported ID converter types. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the custom converter configuration.Gets the date prefix configuration.Gets the friendly format configuration.Gets the group prefix configuration.Gets the static prefix.getRadix()Gets the radix62 configuration.Gets the radix36 configuration.Gets the static suffix.Gets the toString configuration.getType()Gets the converter type.voidSets the custom converter configuration.voidsetDatePrefix(IdConverterDefinition.DatePrefix datePrefix) Sets the date prefix configuration.voidsetFriendly(IdConverterDefinition.Friendly friendly) Sets the friendly format configuration.voidsetGroupPrefix(IdConverterDefinition.GroupPrefix groupPrefix) Sets the group prefix configuration.voidSets the static prefix.voidSets the radix62 configuration.voidsetRadix36(IdConverterDefinition.Radix36 radix36) Sets the radix36 configuration.voidSets the static suffix.voidsetToString(IdConverterDefinition.ToString toString) Sets the toString configuration.voidSets the converter type.
-
Constructor Details
-
IdConverterDefinition
public IdConverterDefinition()
-
-
Method Details
-
getType
Gets the converter type.- Returns:
- the converter type
-
setType
Sets the converter type.- Parameters:
type- the converter type to set
-
getPrefix
Gets the static prefix.- Returns:
- the prefix string, or null if not set
-
setPrefix
Sets the static prefix.- Parameters:
prefix- the prefix to set
-
getGroupPrefix
Gets the group prefix configuration.- Returns:
- the group prefix configuration
-
setGroupPrefix
Sets the group prefix configuration.- Parameters:
groupPrefix- the group prefix configuration to set
-
getSuffix
Gets the static suffix.- Returns:
- the suffix string, or null if not set
-
setSuffix
Sets the static suffix.- Parameters:
suffix- the suffix to set
-
getRadix
Gets the radix62 configuration.- Returns:
- the radix configuration
-
setRadix
Sets the radix62 configuration.- Parameters:
radix- the radix configuration to set
-
getRadix36
Gets the radix36 configuration.- Returns:
- the radix36 configuration
-
setRadix36
Sets the radix36 configuration.- Parameters:
radix36- the radix36 configuration to set
-
getToString
Gets the toString configuration.- Returns:
- the toString configuration, or null if not set
-
setToString
Sets the toString configuration.- Parameters:
toString- the toString configuration to set
-
getCustom
Gets the custom converter configuration.- Returns:
- the custom configuration, or null if not set
-
setCustom
Sets the custom converter configuration.- Parameters:
custom- the custom configuration to set
-
getDatePrefix
Gets the date prefix configuration.- Returns:
- the date prefix configuration
-
setDatePrefix
Sets the date prefix configuration.- Parameters:
datePrefix- the date prefix configuration to set
-
getFriendly
Gets the friendly format configuration.- Returns:
- the friendly configuration
-
setFriendly
Sets the friendly format configuration.- Parameters:
friendly- the friendly configuration to set
-