arrayList = new ArrayList<>(values.length);
+ Collections.addAll(arrayList, values);
+ return arrayList;
+ }
+
+}
diff --git a/mapstruct-plus/src/main/java/io/github/linpeilie/utils/StrUtil.java b/mapstruct-plus/src/main/java/io/github/linpeilie/utils/StrUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..765e62d23688c3526bb90a2cd2cffb82fcd62d47
--- /dev/null
+++ b/mapstruct-plus/src/main/java/io/github/linpeilie/utils/StrUtil.java
@@ -0,0 +1,86 @@
+package io.github.linpeilie.utils;
+
+public class StrUtil {
+
+ /**
+ * 去掉首部指定长度的字符串并将剩余字符串首字母小写
例如:str=setName, preLength=3 =》 return name
+ *
+ * @param str 被处理的字符串
+ * @param preLength 去掉的长度
+ * @return 处理后的字符串,不符合规范返回null
+ */
+ public static String removePreAndLowerFirst(CharSequence str, int preLength) {
+ if (str == null) {
+ return null;
+ }
+ if (str.length() > preLength) {
+ char first = Character.toLowerCase(str.charAt(preLength));
+ if (str.length() > preLength + 1) {
+ return first + str.toString().substring(preLength + 1);
+ }
+ return String.valueOf(first);
+ } else {
+ return str.toString();
+ }
+ }
+
+ /**
+ * 获得set或get或is方法对应的标准属性名
例如:setName 返回 name
+ *
+ *
+ * getName =》name
+ * setName =》name
+ * isName =》name
+ *
+ *
+ * @param getOrSetMethodName Get或Set方法名
+ * @return 如果是set或get方法名,返回field, 否则null
+ */
+ public static String getGeneralField(CharSequence getOrSetMethodName) {
+ final String getOrSetMethodNameStr = getOrSetMethodName.toString();
+ if (getOrSetMethodNameStr.startsWith("get") || getOrSetMethodNameStr.startsWith("set")) {
+ return removePreAndLowerFirst(getOrSetMethodName, 3);
+ } else if (getOrSetMethodNameStr.startsWith("is")) {
+ return removePreAndLowerFirst(getOrSetMethodName, 2);
+ }
+ return null;
+ }
+
+ public static boolean isEmpty(CharSequence cs) {
+ return cs == null || cs.length() == 0;
+ }
+
+ public static boolean isNotEmpty(CharSequence cs) {
+ return !isEmpty(cs);
+ }
+
+ public static boolean equalsIgnoreCase(CharSequence str1, CharSequence str2) {
+ if (null == str1) {
+ // 只有两个都为null才判断相等
+ return str2 == null;
+ }
+ if (null == str2) {
+ // 字符串2空,字符串1非空,直接false
+ return false;
+ }
+
+ return str1.toString().equalsIgnoreCase(str2.toString());
+ }
+
+ public static boolean isBlank(CharSequence str) {
+ final int length;
+ if ((str == null) || ((length = str.length()) == 0)) {
+ return true;
+ }
+
+ for (int i = 0; i < length; i++) {
+ // 只要有一个非空字符即为非空字符串
+ if (false == CharUtils.isBlankChar(str.charAt(i))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+}
diff --git a/pom.xml b/pom.xml
index c908be3a52fd4e3e07a12d9c7b7c9e0af827cddd..904ab4598246053d6b12f4a823b04488155d8936 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,20 +14,26 @@
mapstruct-plus
mapstruct-plus-spring-boot-starter
mapstruct-plus-processor
+ mapstruct-plus-object-convert
- 1.3.6
+ 1.4.0-R1
8
8
UTF-8
1.5.5.Final
- 5.8.15
+ 5.8.26
https://github.com/linpeilie/mapstruct-plus.git
+
+ io.github.linpeilie
+ mapstruct-plus-object-convert
+ ${mapstruct-plus.version}
+
io.github.linpeilie
mapstruct-plus
@@ -43,11 +49,6 @@
javapoet
1.9.0
-
- org.apache.commons
- commons-lang3
- 3.12.0
-
org.mapstruct
mapstruct