Revision 28127
Added by Claudio Atzori almost 10 years ago
modules/dnet-openaireplus-mapping-utils/trunk/src/main/java/eu/dnetlib/data/mapreduce/util/OafDecoder.java | ||
---|---|---|
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
public String getCF() { |
121 |
return decodeRel().getCF(); |
|
121 |
switch (getKind()) { |
|
122 |
case entity: |
|
123 |
return getEntity().getType().toString(); |
|
124 |
case relation: |
|
125 |
return decodeRel().getCF(); |
|
126 |
default: |
|
127 |
throw new IllegalArgumentException("Invalid Kind: " + getKind()); |
|
128 |
} |
|
122 | 129 |
} |
123 | 130 |
|
124 | 131 |
public RelDescriptor getRelDescriptor() { |
132 |
if (!getKind().equals(Kind.relation)) return null; |
|
125 | 133 |
return decodeRel().getRelDescriptor(); |
126 | 134 |
} |
127 | 135 |
|
Also available in: Unified diff
added some checks