123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- package cn.com.ty.lift.common.utils;
- /**
- * Copy to jodd.util
- * <p>
- * Pool of <code>String</code> constants to prevent repeating of
- * hard-coded <code>String</code> literals in the code.
- * Due to fact that these are <code>public static final</code>
- * they will be inlined by java compiler and
- * reference to this class will be dropped.
- * There is <b>no</b> performance gain of using this pool.
- * Read: https://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.5
- * <ul>
- * <li>Literal strings within the same class in the same package represent references to the same <code>String</code> object.</li>
- * <li>Literal strings within different classes in the same package represent references to the same <code>String</code> object.</li>
- * <li>Literal strings within different classes in different packages likewise represent references to the same <code>String</code> object.</li>
- * <li>Strings computed by constant expressions are computed at compile time and then treated as if they were literals.</li>
- * <li>Strings computed by concatenation at run time are newly created and therefore distinct.</li>
- * </ul>
- */
- public interface StrPool {
- String AMPERSAND = "&";
- String AND = "and";
- String AT = "@";
- String ASTERISK = "*";
- String STAR = ASTERISK;
- String BACK_SLASH = "\\";
- String COLON = ":";
- String COMMA = ",";
- String DASH = "-";
- String DOLLAR = "$";
- String DOT = ".";
- String DOTDOT = "..";
- String DOT_CLASS = ".class";
- String DOT_JAVA = ".java";
- String EMPTY = "";
- String EQUALS = "=";
- String FALSE = "false";
- String SLASH = "/";
- String HASH = "#";
- String HAT = "^";
- String LEFT_BRACE = "{";
- String LEFT_BRACKET = "(";
- String LEFT_CHEV = "<";
- String NEWLINE = "\n";
- String N = "n";
- String NO = "no";
- String NULL = "null";
- String OFF = "off";
- String ON = "on";
- String PERCENT = "%";
- String PIPE = "|";
- String PLUS = "+";
- String QUESTION_MARK = "?";
- String EXCLAMATION_MARK = "!";
- String QUOTE = "\"";
- String RETURN = "\r";
- String TAB = "\t";
- String RIGHT_BRACE = "}";
- String RIGHT_BRACKET = ")";
- String RIGHT_CHEV = ">";
- String SEMICOLON = ";";
- String SINGLE_QUOTE = "'";
- String SPACE = " ";
- String LEFT_SQ_BRACKET = "[";
- String RIGHT_SQ_BRACKET = "]";
- String TRUE = "true";
- String UNDERSCORE = "_";
- String UTF_8 = "UTF-8";
- String ISO_8859_1 = "ISO-8859-1";
- String Y = "y";
- String YES = "yes";
- String ONE = "1";
- String ZERO = "0";
- String DOLLAR_LEFT_BRACE = "${";
- String HASH_LEFT_BRACE = "#{";
- String CRLF = "\r\n";
- String HTML_NBSP = " ";
- String HTML_AMP = "&";
- String HTML_QUOTE = """;
- String HTML_LT = "<";
- String HTML_GT = ">";
- // ----------------------------------------------------------------log
- String LOG_PREFIX = "###| ";
- String LOG_LINE = "============================================================";
- String LOG_GLOBAL_EXCEPTION_LINE = "====================== GlobalDefaultException ======================";
- String LOG_URL = StrPool.LOG_PREFIX + "URL : ";
- String LOG_HTTP_METHOD = StrPool.LOG_PREFIX + "HTTP_METHOD : ";
- String LOG_IP = StrPool.LOG_PREFIX + "IP : ";
- String LOG_CLASS_METHOD = StrPool.LOG_PREFIX + "CLASS_METHOD : ";
- String LOG_ARGS = StrPool.LOG_PREFIX + "ARGS : ";
- String LOG_RESPONSE = StrPool.LOG_PREFIX + "RESPONSE : ";
- String LOG_STATUS = StrPool.LOG_PREFIX + "STATUS : ";
- String LOG_EXCEPTION = StrPool.LOG_PREFIX + "EXCEPTION : ";
- //是否打印全部的结果
- boolean LOG_PRINT_ALL = false;
- // 结果字符串 > LOG_PRINT_MAX ,格式化打印首尾(LOG_PRINT_MAX / 2)部分,中间省略
- int LOG_PRINT_MAX = 1000;
- // 方法处理耗时 > LOG_GOOD_TIME,日志到warn中
- long LOG_GOOD_TIME = 10 * 1000;
- // ---------------------------------------------------------------- array
- String[] EMPTY_ARRAY = new String[0];
- byte[] BYTES_NEW_LINE = StrPool.NEWLINE.getBytes();
- // 查询记录的最大时间间隔
- long QUERY_MAX_DAYS = 366;
- }
|