if (usage == null) {
return;
}
if (usage == TupleUsage.KEY_AND_ROW) {
if (!(object instanceof Group)) {
output.reportFailure(new AISValidationFailure(new StorageDescriptionInvalidException(object, "is not a Group and has no row")));
return;
}
}
List<String> illegal;
if (object instanceof Group) {
illegal = TupleRowDataConverter.checkTypes((Group)object, usage);
}
else if (object instanceof Index) {
illegal = TupleRowDataConverter.checkTypes((Index)object, usage);
}
else if (object instanceof Sequence) {
// No types to check
illegal = Collections.emptyList();
}
else {
output.reportFailure(new AISValidationFailure(new StorageDescriptionInvalidException(object, "is not a Group or Index and cannot use Tuples")));
return;
}
if (!illegal.isEmpty()) {
output.reportFailure(new AISValidationFailure(new StorageDescriptionInvalidException(object, "has some types that cannot be stored in a Tuple: " + illegal)));
}
}