接口 StringPool

所有已知子接口:
Constants
所有已知实现类:
AbstractISegmentList, AbstractMethod, Delete, DeleteBatchByIds, DeleteById, DeleteByMap, GroupBySegmentList, HavingSegmentList, Insert, NormalSegmentList, OrderBySegmentList, SelectBatchByIds, SelectById, SelectByMap, SelectCount, SelectList, SelectMaps, SelectMapsPage, SelectObjs, SelectOne, SelectPage, SqlScriptUtils, SqlUtils, TableFieldInfo, TableInfo, Update, UpdateById

public interface StringPool
Copy to jodd.util

Pool of String constants to prevent repeating of hard-coded String literals in the code. Due to fact that these are public static final they will be inlined by java compiler and reference to this class will be dropped. There is no performance gain of using this pool. Read: https://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5

  • Literal strings within the same class in the same package represent references to the same String object.
  • Literal strings within different classes in the same package represent references to the same String object.
  • Literal strings within different classes in different packages likewise represent references to the same String object.
  • Strings computed by constant expressions are computed at compile time and then treated as if they were literals.
  • Strings computed by concatenation at run time are newly created and therefore distinct.