Пример #1
0
 public Annotations mergeWithParent(Annotations parentAnnotations) {
   boolean ignoredButMappedByParent =
       parentAnnotations.containsKey(JsonProperty.class) && containsKey(JsonIgnore.class);
   boolean mappedButIgnoredByParent =
       parentAnnotations.containsKey(JsonIgnore.class) && containsKey(JsonProperty.class);
   Annotations annotations =
       MapUtil.merge(
           this,
           parentAnnotations,
           annotation -> annotation,
           (annotation, annotationParent) -> annotation);
   if (ignoredButMappedByParent) {
     annotations.remove(JsonProperty.class);
   }
   if (mappedButIgnoredByParent) {
     annotations.remove(JsonIgnore.class);
   }
   return annotations;
 }
Пример #2
0
 public Annotations mergeWith(Annotations map) {
   return MapUtil.merge(
       this, map, annotation -> annotation, (annotation, annotationParent) -> annotation);
 }