Class NumberSeries
java.lang.Object
de.hybris.platform.jalo.numberseries.NumberSeries
- All Implemented Interfaces:
Serializable
Represents a serial number generated by
NumberSeriesManager.getUniqueNumber(String, int) or
SerialNumberGenerator.getUniqueNumber(String).
Generally unique numbers should be obtained via NumberSeriesManager.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.apache.log4j.Loggerstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionNumberSeries(String key, long value, int type) Deprecated.NumberSeries(String key, long value, int type, String template) Creates a new number series value with the given key, value and type.NumberSeries(String key, String formattedValue, int type) Deprecated.since 5.0 - please useNumberSeries(String, String, int, String)NumberSeries(String key, String formattedValue, int type, String template) Creates a new number series value with the given key, formatted value and type. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringapplyPatternIfExists(String formattedNumber) longReturns the long representation this value.Deprecated.since ages - usegetFormatted(int)insteadgetFormatted(int digits) Returns a formatted version of this value.getKey()The sequence key.The sequence template.intgetType()The sequence type.protected StringreplaceSpecialCharacters(String template, String formattedNumber) voidsetCurrentValue(String value) Deprecated.since ages - has no functionvoidDeprecated.since ages - has no functionvoidsetTemplate(String template) Deprecated.since ages - has no functionvoidsetType(int type) Deprecated.since ages - has no function
-
Field Details
-
LOG
public static org.apache.log4j.Logger LOG -
TYPE_ALPHANUMERIC
public static final int TYPE_ALPHANUMERIC- See Also:
-
TYPE_NUMERIC
public static final int TYPE_NUMERIC- See Also:
-
-
Constructor Details
-
NumberSeries
@Deprecated(since="5.0", forRemoval=false) public NumberSeries(String key, String formattedValue, int type) Deprecated.since 5.0 - please useNumberSeries(String, String, int, String)Creates a new number series value with the given key, formatted value and type.- Parameters:
key- the number series keyformattedValue- a formatted valuetype- the sequence type seeNumberGenerator.NumberSeriesConstants.TYPES- Throws:
NumberFormatException- if the formatted value could not be parsed while calculating its long representation
-
NumberSeries
Creates a new number series value with the given key, formatted value and type.- Parameters:
key- the number series keyformattedValue- a formatted valuetype- the sequence type seeNumberGenerator.NumberSeriesConstants.TYPEStemplate- the template to be applied on generated number- Throws:
NumberFormatException- if the formatted value could not be parsed while calculating its long representation
-
NumberSeries
Deprecated.since 5.0 - please useNumberSeries(String, long, int, String)Creates a new number series value with the given key, value and type.- Parameters:
key- the key of the number series valuevalue- the long valuetype- the series type
-
NumberSeries
Creates a new number series value with the given key, value and type.- Parameters:
key- the key of the number series valuevalue- the long valuetype- the series typetemplate- the template to be used with generated number
-
-
Method Details
-
getCurrentNumber
public long getCurrentNumber()Returns the long representation this value. -
getCurrentValue
Deprecated.since ages - usegetFormatted(int)insteadThe formatted value. -
getFormatted
Returns a formatted version of this value. The result text contains at least the number of specified characters. If the underlying number does not fill it completely zeros are prepended.- Parameters:
digits- the number of digits to fill; if < 0 no leading zeros are prepended
-
applyPatternIfExists
-
replaceSpecialCharacters
-
getTemplate
The sequence template. -
getKey
The sequence key. -
getType
public int getType()The sequence type. Should be one ofTYPE_ALPHANUMERICorTYPE_NUMERIC- otherwisegetFormatted(int)will always return numeric values. -
setTemplate
Deprecated.since ages - has no function -
setCurrentValue
Deprecated.since ages - has no function -
setKey
Deprecated.since ages - has no function -
setType
Deprecated.since ages - has no function
-
NumberSeries(String, long, int, String)