Revision 57533
Added by Claudio Atzori over 4 years ago
ProtoConverter.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
public static Oaf convert(OafProtos.Oaf oaf) { |
13 | 13 |
try { |
14 |
if (oaf.getKind() == KindProtos.Kind.entity) |
|
15 |
return convertEntity(oaf); |
|
16 |
else { |
|
17 |
return convertRelation(oaf); |
|
14 |
switch (oaf.getKind()) { |
|
15 |
case entity: |
|
16 |
return convertEntity(oaf); |
|
17 |
case relation: |
|
18 |
return convertRelation(oaf); |
|
19 |
default: |
|
20 |
throw new IllegalArgumentException("invalid kind " + oaf.getKind()); |
|
18 | 21 |
} |
19 | 22 |
} catch (Throwable e) { |
20 | 23 |
throw new RuntimeException("error on getting " + JsonFormat.printToString(oaf), e); |
Also available in: Unified diff
fixed infospace export procedure, avoid to emit the same result more than once