summaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/internal/styles/HighlightMatcher.java
blob: 2e0481b08551243445ccbc4b57d5643b4e2e2163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package org.zwobble.mammoth.internal.styles;

import java.util.Optional;

public class HighlightMatcher implements DocumentElementMatcher<String> {
    private final Optional<String> color;

    public HighlightMatcher(Optional<String> color) {
        this.color = color;
    }

    @Override
    public boolean matches(String color) {
        return !this.color.isPresent() || this.color.get().equals(color);
    }
}