Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

1 changed file:

Changes:

  • services/local-impl/src/main/java/fr/ird/observe/services/local/service/referential/ReferentialShellBuilder.java
    ... ... @@ -42,22 +42,6 @@ public class ReferentialShellBuilder {
    42 42
     
    
    43 43
         private final GetEntityReferentialShellVisitor visitor;
    
    44 44
     
    
    45
    -    private ReferentialShellBuilder(ImmutableSetStringMap incomingReferentialIds) {
    
    46
    -        visitor = new GetEntityReferentialShellVisitor(incomingReferentialIds);
    
    47
    -    }
    
    48
    -
    
    49
    -    public static ReferentialShellBuilder builder(ImmutableSetStringMap incomingReferentialIds) {
    
    50
    -        return new ReferentialShellBuilder(incomingReferentialIds);
    
    51
    -    }
    
    52
    -
    
    53
    -    void scan(TopiaEntity entity) {
    
    54
    -        entity.accept(visitor);
    
    55
    -    }
    
    56
    -
    
    57
    -    public ImmutableSetStringMap build() {
    
    58
    -        return visitor.missingReferentialIds.build();
    
    59
    -    }
    
    60
    -
    
    61 45
         private static class GetEntityReferentialShellVisitor implements TopiaEntityVisitor {
    
    62 46
     
    
    63 47
             private final Set<String> hitIds;
    
    ... ... @@ -100,11 +84,11 @@ public class ReferentialShellBuilder {
    100 84
     
    
    101 85
             @Override
    
    102 86
             public void visit(TopiaEntity entity, String propertyName, Class<?> collectionType, Class<?> type, Object value) {
    
    103
    -            if (TopiaEntity.class.isAssignableFrom(type))
    
    104
    -            for (Object child : ((Collection<?>) value)) {
    
    105
    -                ((TopiaEntity) child).accept(this);
    
    87
    +            if (TopiaEntity.class.isAssignableFrom(type)) {
    
    88
    +                for (Object child : ((Collection<?>) value)) {
    
    89
    +                    ((TopiaEntity) child).accept(this);
    
    90
    +                }
    
    106 91
                 }
    
    107
    -
    
    108 92
             }
    
    109 93
     
    
    110 94
             @Override
    
    ... ... @@ -120,4 +104,20 @@ public class ReferentialShellBuilder {
    120 104
             }
    
    121 105
         }
    
    122 106
     
    
    107
    +    public static ReferentialShellBuilder builder(ImmutableSetStringMap incomingReferentialIds) {
    
    108
    +        return new ReferentialShellBuilder(incomingReferentialIds);
    
    109
    +    }
    
    110
    +
    
    111
    +    private ReferentialShellBuilder(ImmutableSetStringMap incomingReferentialIds) {
    
    112
    +        visitor = new GetEntityReferentialShellVisitor(incomingReferentialIds);
    
    113
    +    }
    
    114
    +
    
    115
    +    void scan(TopiaEntity entity) {
    
    116
    +        entity.accept(visitor);
    
    117
    +    }
    
    118
    +
    
    119
    +    public ImmutableSetStringMap build() {
    
    120
    +        return visitor.missingReferentialIds.build();
    
    121
    +    }
    
    122
    +
    
    123 123
     }