aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/internal/documents/Table.java
blob: 7656a9323d4cd2d780f509fe7948a471b365581e (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
33
package org.zwobble.mammoth.internal.documents;

import java.util.List;
import java.util.Optional;

public class Table implements DocumentElement, HasChildren {
    private final Optional<Style> style;
    private final List<DocumentElement> children;

    public Table(Optional<Style> style, List<DocumentElement> children) {
        this.style = style;
        this.children = children;
    }

    public Optional<Style> getStyle() {
        return style;
    }

    @Override
    public List<DocumentElement> getChildren() {
        return children;
    }

    @Override
    public DocumentElement replaceChildren(List<DocumentElement> newChildren) {
        return new Table(this.style, newChildren);
    }

    @Override
    public <T, U> T accept(DocumentElementVisitor<T, U> visitor, U context) {
        return visitor.visit(this, context);
    }
}