blob: 1d620767d58c512f8158482ffb3c924a05075389 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
package org.zwobble.mammoth.documents;
import java.util.List;
import java.util.Optional;
public class Hyperlink implements DocumentElement, HasChildren {
public static Hyperlink href(String href, List<DocumentElement> children) {
return new Hyperlink(Optional.of(href), children);
}
private final Optional<String> href;
private final List<DocumentElement> children;
public Hyperlink(Optional<String> href, List<DocumentElement> children) {
this.href = href;
this.children = children;
}
public Optional<String> getHref() {
return href;
}
@Override
public List<DocumentElement> getChildren() {
return children;
}
@Override
public <T> T accept(DocumentElementVisitor<T> visitor) {
return visitor.visit(this);
}
}
|