package io.netty.handler.ssl;

import g.a.a.a.a;

/* JADX INFO: loaded from: classes.dex */
public final class SniCompletionEvent extends SslCompletionEvent {
    private final String hostname;

    public SniCompletionEvent(String str) {
        this.hostname = str;
    }

    public SniCompletionEvent(String str, Throwable th) {
        super(th);
        this.hostname = str;
    }

    public SniCompletionEvent(Throwable th) {
        this(null, th);
    }

    public String hostname() {
        return this.hostname;
    }

    @Override // io.netty.handler.ssl.SslCompletionEvent
    public String toString() {
        Throwable thCause = cause();
        if (thCause == null) {
            StringBuilder sb = new StringBuilder();
            sb.append(SniCompletionEvent.class.getSimpleName());
            sb.append("(SUCCESS='");
            return a.A(sb, this.hostname, "'\")");
        }
        return SniCompletionEvent.class.getSimpleName() + '(' + thCause + ')';
    }
}
