Skip to content

Commit

Permalink
0.0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pizihao committed Jun 28, 2022
1 parent dcac805 commit b888691
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/main/java/com/deep/crow/compress/MapCompress.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,18 @@ public <T> T compress() {

@Override
public boolean check() {
Map.Entry<?, ?> firstKeyValue = compress();
ParameterizedType parameterizedType = (ParameterizedType) type;
Type keyArgument = parameterizedType.getActualTypeArguments()[0];
Type valueArgument = parameterizedType.getActualTypeArguments()[1];
CrowTypeReference<?> keyTypeReference = CrowTypeReference.make(keyArgument);
CrowTypeReference<?> valueTypeReference = CrowTypeReference.make(valueArgument);
objectMapper.convertValue(firstKeyValue.getKey(), keyTypeReference);
objectMapper.convertValue(firstKeyValue.getValue(), valueTypeReference);
return false;
try {
Map.Entry<?, ?> firstKeyValue = compress();
ParameterizedType parameterizedType = (ParameterizedType) type;
Type keyArgument = parameterizedType.getActualTypeArguments()[0];
Type valueArgument = parameterizedType.getActualTypeArguments()[1];
CrowTypeReference<?> keyTypeReference = CrowTypeReference.make(keyArgument);
CrowTypeReference<?> valueTypeReference = CrowTypeReference.make(valueArgument);
objectMapper.convertValue(firstKeyValue.getKey(), keyTypeReference);
objectMapper.convertValue(firstKeyValue.getValue(), valueTypeReference);
return true;
} catch (Exception e) {
return false;
}
}
}

0 comments on commit b888691

Please sign in to comment.