osglworks / java-tool

Some simple common Java utilities
Apache License 2.0
52 stars 18 forks source link

Convert framework - create a mechanism for fall back converter #133

Open greenlaw110 opened 6 years ago

greenlaw110 commented 6 years ago

Certainly there are multiple convert paths, e.g. from a String to a DateTime it could be

  1. String -> DateTime directly via StringFormat
  2. String -> long -> DateTime if the String is a Unix Epoch

The mechanism shall allow it try the next path if the current path conversion failed. To avoid performance issue the fallback shall only effective through specific API flag