* @throws IllegalArgumentException 引数に{@code null}が指定された場合
*/
public ShuffleKey getJoinKey(TypeMirror target) {
Precondition.checkMustNotBeNull(target, "target"); //$NON-NLS-1$
DataModelMirror model = environment.loadDataModel(target);
AnnotationMirror annotation = findAnnotation(element, environment.getDeclaredType(Joined.class));
if (model == null || annotation == null) {
throw new IllegalArgumentException();
}
Map<String, AnnotationValue> values = getValues(annotation);
List<? extends AnnotationValue> terms = getList(values, "terms");
if (terms == null) {
throw new IllegalArgumentException();
}
for (AnnotationValue value : terms) {
if ((value.getValue() instanceof AnnotationMirror) == false) {
continue;
}
AnnotationMirror term = (AnnotationMirror) value.getValue();
if (typeEqual(target, getReduceTermType(term))) {
AnnotationMirror shuffle = getReduceTermKey(term);
ShuffleKey key = toShuffleKey(-1, model, shuffle);
return key;
}
}
throw new IllegalArgumentException();