Package com.reve.utils.string
Class StringBuilderUtil
java.lang.Object
com.reve.utils.string.StringBuilderUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringBuilderappendNumber(StringBuilder stringBuilder, long value, int digitCounts) Append the given number into theStringBuilder.
-
Constructor Details
-
StringBuilderUtil
public StringBuilderUtil()
-
-
Method Details
-
appendNumber
Append the given number into theStringBuilder. It will be made sure that the number takes exactly the given number of digit count. If thevalueexceeds the number of digits than the given number ofdigitCounts, it will discard the most significant numbers. And if thevaluehave less digits than givendigitCounts, it will add extra 0 as prefix to the number. for example value = 10, digitCounts = 3 will append 010 value = 1234, digitCounts = 3 will append 234- Parameters:
stringBuilder- given number will be appended into this instance.value- this value will be appended.digitCounts- number of digits to be appended.- Returns:
- the same instance of
StringBuilder
-