/** Given an iterable-like object, try to determine its static (i.e, without looking at contents) element type. */ public static Optional<Type> elementTypeOf(Object iterable) { return elementTypeOf(iterable.getClass()); }
@Override public Optional<Argument> build(Type type, Object value, ConfigRegistry config) { return IterableLike.elementTypeOf(type) .flatMap(config.get(SqlArrayTypes.class)::findFor) .map(arrayType -> arrayArgument(value, arrayType)); }