类 CommonUtils

java.lang.Object
com.publiccms.common.tools.CommonUtils

public class CommonUtils extends Object
CommonUtils 通用Utils
  • 字段详细资料

    • dontNeedEncoding

      private static BitSet dontNeedEncoding
    • caseDiff

      private static final int caseDiff
      另请参阅:
  • 构造器详细资料

    • CommonUtils

      private CommonUtils()
  • 方法详细资料

    • listToMap

      public static <T, F> Map<F,T> listToMap(List<T> list, Function<T,F> keyMapper)
      类型参数:
      T -
      F -
      参数:
      list -
      keyMapper -
      返回:
    • listToMapSorted

      public static <T, F, K> Map<F,T> listToMapSorted(List<T> list, Function<T,F> keyMapper, K[] sortKeys)
      类型参数:
      T -
      F -
      参数:
      list -
      keyMapper -
      sortKeys -
      返回:
    • listToMapSorted

      public static <T, F, K> Map<F,T> listToMapSorted(List<T> list, Function<T,F> keyMapper, UnaryOperator<T> valueMapper, K[] sortKeys, Predicate<T> filter)
      类型参数:
      T -
      F -
      参数:
      list -
      keyMapper -
      valueMapper -
      sortKeys -
      filter -
      返回:
    • listToMap

      public static <T, F> Map<F,T> listToMap(List<T> list, Function<T,F> keyMapper, UnaryOperator<T> valueMapper, Comparator<? super T> comparator, Predicate<T> filter)
      类型参数:
      T -
      F -
      参数:
      list -
      keyMapper -
      valueMapper -
      comparator -
      filter -
      返回:
    • encodeURI

      public static String encodeURI(String s)
    • joinString

      @SafeVarargs public static <T> String joinString(T... elements)
      参数:
      elements -
      返回:
      拼接后的文本
    • keep

      public static String keep(String string, int length)
      参数:
      string -
      length -
      返回:
      截取后的文本
    • keep

      public static String keep(String string, int length, String append)
      参数:
      string -
      length -
      append -
      返回:
      截取后的文本
    • getDate

      public static Date getDate()
      返回:
      当前日期
    • getMinuteDate

      public static Date getMinuteDate()
      返回:
      精确到分钟的当前日期
    • notEmpty

      public static boolean notEmpty(String value)
      参数:
      value -
      返回:
      是否为非空
    • empty

      public static boolean empty(String value)
      参数:
      value -
      返回:
      是否为空
    • notEmpty

      public static boolean notEmpty(Number value)
      参数:
      value -
      返回:
      是否非空
    • empty

      public static boolean empty(Number value)
      参数:
      value -
      返回:
      是否为空
    • empty

      public static boolean empty(Map<?,?> value)
      参数:
      value -
      返回:
      是否为空
    • notEmpty

      public static boolean notEmpty(Collection<?> value)
      参数:
      value -
      返回:
      是否非空
    • notEmpty

      public static boolean notEmpty(Map<?,?> value)
      参数:
      value -
      返回:
      是否非空
    • notEmpty

      public static boolean notEmpty(File file)
      参数:
      file -
      返回:
      是否非空
    • empty

      public static boolean empty(File file)
      参数:
      file -
      返回:
      是否为空
    • notEmpty

      public static boolean notEmpty(String[] value)
      参数:
      value -
      返回:
      是否非空
    • notEmpty

      public static boolean notEmpty(Object[] value)
      参数:
      value -
      返回:
      是否非空
    • empty

      public static boolean empty(Object[] value)
      参数:
      value -
      返回:
      是否为空
    • getConfig

      public static String getConfig(Properties config, String key)