package org.zwobble.mammoth.internal.documents; import org.zwobble.mammoth.internal.util.InputStreamSupplier; import java.io.IOException; import java.io.InputStream; import java.util.Optional; public class Image implements DocumentElement { private final Optional altText; private final Optional contentType; private final InputStreamSupplier open; public Image(Optional altText, Optional contentType, InputStreamSupplier open) { this.altText = altText; this.contentType = contentType; this.open = open; } public Optional getAltText() { return altText; } public Optional getContentType() { return contentType; } public InputStream open() throws IOException { return open.open(); } @Override public T accept(DocumentElementVisitor visitor, U context) { return visitor.visit(this, context); } }