Package org.idempiere.util
Class ParseSeq
java.lang.Object
org.idempiere.util.ParseSeq
This class help to parse ordered configuration.
For example, problem in IDEMPIERE-2296. Some wish priority of "default value" is higher than "user value preference" and some other wish the reverse of that.
It is better to define 1 is representative for "default value" and 2 is representative for "user value preference", and in configuration just set 12 or 21 for an ordered configuration.
For example, problem in IDEMPIERE-2296. Some wish priority of "default value" is higher than "user value preference" and some other wish the reverse of that.
It is better to define 1 is representative for "default value" and 2 is representative for "user value preference", and in configuration just set 12 or 21 for an ordered configuration.
This class will help by providing method similar to Iterable and it also provide validation for duplicate value such as 221 or 211.
- Author:
- hieplq
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classsupport class for iterator throw start to end of order -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ParseSeqgetNumberOrder(String orderConfiguration) constructor maybe become complicate by add more validate (don't allow space, don't allow special,...)iterator()static voidrun test for utilityprotected voidparseValue(String orderConfiguration, boolean allowDupCharacter, boolean onlyNumber) validate input stringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
MSG_NOT_NULL
-
MSG_ONLY_NUNBER
-
MSG_CONTAIN_DUP
-
-
Method Details
-
parseValue
validate input string- Parameters:
orderConfiguration-allowDupCharacter-onlyNumber-
-
iterator
-
getNumberOrder
constructor maybe become complicate by add more validate (don't allow space, don't allow special,...) use get for simple when init this object, don't need add try catch block when use- Parameters:
orderConfiguration-- Returns:
- null when input string isn't suitable
-
main
run test for utility- Parameters:
args-
-
toString
-