class SiddhiTypeFactory {

    public static <T extends Tuple> TypeInformation<T> getTupleTypeInformation(AbstractDefinition definition) {
        List<TypeInformation> types = new ArrayList<>();
        for (Attribute attribute : definition.getAttributeList()) {
            types.add(TypeInformation.of(getJavaType(attribute.getType())));
        }
        try {
            return Types.TUPLE(types.toArray(new TypeInformation[0]));
        } catch (IllegalArgumentException ex) {
            throw new IllegalArgumentException("Unable to parse ", ex);
        }
    }

}