Skip to content

Commit

Permalink
poClzz.ignored.props
Browse files Browse the repository at this point in the history
  • Loading branch information
sim-wangyan committed Aug 18, 2023
1 parent 7c678f4 commit 54f8b7c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/io/xream/sspoin/NonRepeatableFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static void beforeCreate(
Errors errors, Parsed parsed,
List paraList,
Class poClzz,
List<String> poIgnoredPropList,
NonRepeatableExistedCond nonRepeatableExistedCond,
ExistedFinder existedFinder) {

Expand All @@ -93,7 +94,7 @@ public static void beforeCreate(
throw new IllegalArgumentException("savedFinder can not null");
}

Set<String> poPropSet = poFieldNames(poClzz);
Set<String> poPropSet = poFieldNames(poClzz,poIgnoredPropList);

List<String> nonRepeatableProps = parsed.getNonRepeatableProps();

Expand All @@ -110,14 +111,16 @@ public static void beforeCreate(
handleRepeated(poPropSet,poExistList,errors,parsed,nonRepeatableProps,paraList);
}

private static Set<String> poFieldNames(Class poClzz) {
private static Set<String> poFieldNames(Class poClzz, List<String> poIgnoredPropList) {

if (poClzz == null)
throw new IllegalArgumentException("PO Class must not be null");

Field[] arr = poClzz.getDeclaredFields();
Set<String> propSet = new HashSet<>();
for (Field field : arr) {
if (poIgnoredPropList!=null && poIgnoredPropList.contains(field.getName()))
continue;
propSet.add(field.getName());
}
return propSet;
Expand Down

0 comments on commit 54f8b7c

Please sign in to comment.