java.lang.Object
org.apache.wicket.util.LongEncoder
Encodes long values into the specified alphabet. Encoding is useful when long values need to be
represented in their string form and shorter values are preferred; by using alphabets of length
greater than ten shorter values can be obtained. For example, to encode values into their
hexadecimal representations the
0123456789ABCDEF- can be used. Long values can be
shortened even further by using longer alphabets. The last character in the alphabet is used as
the negative sign.- Author:
- igor
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longDecodes value using the default alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"static longDecodes value using the specified alphabetstatic Stringencode(long value) Encodes the value into the default alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"static StringEncodes value into the specified alphabet
-
Field Details
-
DEFAULT
default alphabet that should be safe to use in most circumstances, while still providing good shortening of long values- See Also:
-
-
Method Details
-
encode
Encodes the value into the default alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"- Parameters:
value-- Returns:
- encoded value
-
decode
Decodes value using the default alphabet: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"- Parameters:
value-- Returns:
- decoded value
-
encode
Encodes value into the specified alphabet- Parameters:
value-alphabet-- Returns:
- encoded value
-
decode
Decodes value using the specified alphabet- Parameters:
value-alphabet-- Returns:
- decoded value
-