summaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/com/wireguard/config/ParseException.java
blob: c8482af22f267789bbb374146e5df412552a8aba (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
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright © 2018 WireGuard LLC. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package com.wireguard.config;

import android.support.annotation.Nullable;

/**
 */
public class ParseException extends Exception {
    private final Class<?> parsingClass;
    private final CharSequence text;

    public ParseException(final Class<?> parsingClass, final CharSequence text,
                          @Nullable final String message, @Nullable final Throwable cause) {
        super(message, cause);
        this.parsingClass = parsingClass;
        this.text = text;
    }

    public ParseException(final Class<?> parsingClass, final CharSequence text,
                          @Nullable final String message) {
        this(parsingClass, text, message, null);
    }

    public ParseException(final Class<?> parsingClass, final CharSequence text,
                          @Nullable final Throwable cause) {
        this(parsingClass, text, null, cause);
    }

    public ParseException(final Class<?> parsingClass, final CharSequence text) {
        this(parsingClass, text, null, null);
    }

    public Class<?> getParsingClass() {
        return parsingClass;
    }

    public CharSequence getText() {
        return text;
    }
}