aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/zwobble/mammoth/internal/styles/parsing/Token.java
blob: bf009c0606c7ccd12e49adac3b4c8ee4c4adb7ca (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
package org.zwobble.mammoth.internal.styles.parsing;

public class Token<T> {
    private final int characterIndex;
    private final T tokenType;
    private final String value;

    public Token(int characterIndex, T tokenType, String value) {
        this.characterIndex = characterIndex;
        this.tokenType = tokenType;
        this.value = value;
    }

    public int getCharacterIndex() {
        return characterIndex;
    }

    public T getTokenType() {
        return tokenType;
    }

    public String getValue() {
        return value;
    }

    @Override
    public String toString() {
        return "Token(tokenType=" + tokenType + ", value=" + value + ")";
    }
}