Package 

Class ComponentExtensions

    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> T convert(Object $self, Map<String, Object> configParams) 根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则抛出异常。
      final static <T extends Any> T convert(Object $self, Class<T> targetType, Map<String, Object> configParams) 根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则抛出异常。
      final static Object convert(Object $self, Type targetType, Map<String, Object> configParams) 根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则抛出异常。
      final static <T extends Any> T convertOrNull(Object $self, Map<String, Object> configParams) 根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则返回null。
      final static <T extends Any> T convertOrNull(Object $self, Class<T> targetType, Map<String, Object> configParams) 根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则返回null。
      final static Object convertOrNull(Object $self, Type targetType, Map<String, Object> configParams) 根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则返回null。
      final static String encodeBy(String $self, Encoder encoder, Charset charset) 根据指定的编码器,编码当前字符串,以指定的字符集显示。
      final static String decodeBy(String $self, Encoder encoder, Charset charset) 根据指定的编码器,解码当前字符串,以指定的字符集显示。
      final static ByteArray encryptBy(ByteArray $self, Encrypter encrypter, ByteArray secret) 根据指定的加密器,加密当前字节数组。
      final static ByteArray decryptBy(ByteArray $self, Encrypter encrypter, ByteArray secret) 根据指定的加密器,解密当前字符串。某些加密算法可能不支持解密。
      final static String escapeBy(String $self, Escaper escaper) 根据指定的转义器,转义当前字符串。
      final static String unescapeBy(String $self, Escaper escaper) 根据指定的转义器,反转义当前字符串。
      final static <T extends Any> T defaultValue(Map<String, Object> configParams) 根据可选的配置参数,生成指定类型的默认值。
      final static <T extends Any> T defaultValue(Class<T> targetType, Map<String, Object> configParams) 根据可选的配置参数,生成指定类型的默认值。
      final static <T extends Any> T defaultValue(Type targetType, Map<String, Object> configParams) 根据可选的配置参数,生成指定类型的默认值。
      final static <T extends Any> T randomValue(Map<String, Object> configParams) 根据可选的配置参数,生成指定类型的随机值。
      final static <T extends Any> T randomValue(Class<T> targetType, Map<String, Object> configParams) 根据可选的配置参数,生成指定类型的随机值。
      final static <T extends Any> T randomValue(Type targetType, Map<String, Object> configParams) 根据可选的配置参数,生成指定类型的随机值。
      final static Boolean matchesBy(String $self, StringPattern stringPattern) 判断指定的字符串是否匹配指定的字符串模式。
      final static Boolean matchesBy(String $self, String path, PathPattern pathPattern) 根据指定的路径类型,判断当前字符串是否匹配指定的路径。 默认使用标准路径PathPattern.StandardPath
      final static Boolean matchesBy(String $self, LetterCase letterCase) 判断当前字符串是否匹配指定的字母格式。
      final static Map<String, String> resolveVariablesBy(String $self, String path, PathPattern pathPattern) 根据指定的路径类型,解析路径变量。如果路径不匹配,则返回空结果。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> List<T> queryBy(Array<?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型查询当前数组,返回查询结果列表。 如果指定路径为空路径,则目标返回查询对象的单例列表。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> List<T> queryBy(List<?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型查询当前列表,返回查询结果列表。 如果指定路径为空路径,则目标返回查询对象的单例列表。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> List<T> queryBy(Map<?, ?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型递归查询当前映射,返回查询结果列表。 如果指定路径为空路径,则目标返回查询对象的单例列表。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getBy(Array<?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getBy(List<?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getBy(Map<?, ?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrNullBy(Array<?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrNullBy(List<?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrNullBy(Map<?, ?> $self, String path, PathPattern pathPattern) 根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrDefaultBy(Array<?> $self, String path, PathPattern pathPattern, T defaultValue) 根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrDefaultBy(List<?> $self, String path, PathPattern pathPattern, T defaultValue) 根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrDefaultBy(Map<?, ?> $self, String path, PathPattern pathPattern, T defaultValue) 根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrElseBy(Array<?> $self, String path, PathPattern pathPattern, Function0<T> defaultValue) 根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrElseBy(List<?> $self, String path, PathPattern pathPattern, Function0<T> defaultValue) 根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static <T extends Any> T getOrElseBy(Map<?, ?> $self, String path, PathPattern pathPattern, Function0<T> defaultValue) 根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath
      final static LetterCase inferCase(String $self) 尝试推断当前字符串的字母格式。
      final static List<String> splitBy(String $self, LetterCase letterCase) 根据指定的字母格式,分割当前字符串,返回对应的字符串列表。
      final static Sequence<String> splitToSequenceBy(String $self, LetterCase letterCase) 根据指定的字母格式,分割当前字符串,返回对应的字符串序列。
      final static String joinToStringBy(Array<String> $self, LetterCase letterCase) 根据指定的字母格式,将当前字符串数组中的元素加入到字符串。
      final static String joinToStringBy(Iterable<String> $self, LetterCase letterCase) 根据指定的字母格式,将当前字符串集合中的元素加入到字符串。
      final static String joinToStringBy(Sequence<String> $self, LetterCase letterCase) 根据指定的字母格式,将当前字符串序列中的元素加入到字符串。
      final static String switchCaseBy(String $self, LetterCase sourceLetterCase, LetterCase targetLetterCase) 根据指定的字母格式,切换当前字符串的格式。
      final static String switchCaseBy(String $self, LetterCase targetLetterCase) 根据指定的字母格式,切换当前字符串的格式。如果不指定字母格式,则尝试推断或者抛出异常。
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • convert

         final static <T extends Any> T convert(Object $self, Map<String, Object> configParams)

        根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则抛出异常。

      • convert

         final static <T extends Any> T convert(Object $self, Class<T> targetType, Map<String, Object> configParams)

        根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则抛出异常。

      • convert

         final static Object convert(Object $self, Type targetType, Map<String, Object> configParams)

        根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则抛出异常。

      • convertOrNull

         final static <T extends Any> T convertOrNull(Object $self, Map<String, Object> configParams)

        根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则返回null。

      • convertOrNull

         final static <T extends Any> T convertOrNull(Object $self, Class<T> targetType, Map<String, Object> configParams)

        根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则返回null。

      • convertOrNull

         final static Object convertOrNull(Object $self, Type targetType, Map<String, Object> configParams)

        根据可选的配置参数,将当前对象转化为指定类型。如果转换失败,则返回null。

      • encodeBy

         final static String encodeBy(String $self, Encoder encoder, Charset charset)

        根据指定的编码器,编码当前字符串,以指定的字符集显示。

      • decodeBy

         final static String decodeBy(String $self, Encoder encoder, Charset charset)

        根据指定的编码器,解码当前字符串,以指定的字符集显示。

      • defaultValue

         final static <T extends Any> T defaultValue(Map<String, Object> configParams)

        根据可选的配置参数,生成指定类型的默认值。

      • defaultValue

         final static <T extends Any> T defaultValue(Class<T> targetType, Map<String, Object> configParams)

        根据可选的配置参数,生成指定类型的默认值。

      • defaultValue

         final static <T extends Any> T defaultValue(Type targetType, Map<String, Object> configParams)

        根据可选的配置参数,生成指定类型的默认值。

      • randomValue

         final static <T extends Any> T randomValue(Map<String, Object> configParams)

        根据可选的配置参数,生成指定类型的随机值。

      • randomValue

         final static <T extends Any> T randomValue(Class<T> targetType, Map<String, Object> configParams)

        根据可选的配置参数,生成指定类型的随机值。

      • randomValue

         final static <T extends Any> T randomValue(Type targetType, Map<String, Object> configParams)

        根据可选的配置参数,生成指定类型的随机值。

      • queryBy

         final static <T extends Any> List<T> queryBy(Array<?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型查询当前数组,返回查询结果列表。 如果指定路径为空路径,则目标返回查询对象的单例列表。 默认使用标准路径PathPattern.StandardPath

      • queryBy

         final static <T extends Any> List<T> queryBy(List<?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型查询当前列表,返回查询结果列表。 如果指定路径为空路径,则目标返回查询对象的单例列表。 默认使用标准路径PathPattern.StandardPath

      • queryBy

         final static <T extends Any> List<T> queryBy(Map<?, ?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型递归查询当前映射,返回查询结果列表。 如果指定路径为空路径,则目标返回查询对象的单例列表。 默认使用标准路径PathPattern.StandardPath

      • getBy

         final static <T extends Any> T getBy(Array<?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getBy

         final static <T extends Any> T getBy(List<?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getBy

         final static <T extends Any> T getBy(Map<?, ?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者抛出异常。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrNullBy

         final static <T extends Any> T getOrNullBy(Array<?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrNullBy

         final static <T extends Any> T getOrNullBy(List<?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrNullBy

         final static <T extends Any> T getOrNullBy(Map<?, ?> $self, String path, PathPattern pathPattern)

        根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者返回null。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrDefaultBy

         final static <T extends Any> T getOrDefaultBy(Array<?> $self, String path, PathPattern pathPattern, T defaultValue)

        根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrDefaultBy

         final static <T extends Any> T getOrDefaultBy(List<?> $self, String path, PathPattern pathPattern, T defaultValue)

        根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrDefaultBy

         final static <T extends Any> T getOrDefaultBy(Map<?, ?> $self, String path, PathPattern pathPattern, T defaultValue)

        根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrElseBy

         final static <T extends Any> T getOrElseBy(Array<?> $self, String path, PathPattern pathPattern, Function0<T> defaultValue)

        根据指定路径和指定路径类型查询当前数组,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrElseBy

         final static <T extends Any> T getOrElseBy(List<?> $self, String path, PathPattern pathPattern, Function0<T> defaultValue)

        根据指定路径和指定路径类型查询当前列表,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • getOrElseBy

         final static <T extends Any> T getOrElseBy(Map<?, ?> $self, String path, PathPattern pathPattern, Function0<T> defaultValue)

        根据指定路径和指定路径类型递归查询当前映射,得到首个匹配的值,或者返回默认值。 如果指定路径为空路径,则目标返回查询对象本身。 默认使用标准路径PathPattern.StandardPath

      • splitBy

         final static List<String> splitBy(String $self, LetterCase letterCase)

        根据指定的字母格式,分割当前字符串,返回对应的字符串列表。

      • switchCaseBy

         final static String switchCaseBy(String $self, LetterCase targetLetterCase)

        根据指定的字母格式,切换当前字符串的格式。如果不指定字母格式,则尝试推断或者抛出异常。