package io.netty.handler.codec.redis;

import io.netty.util.internal.StringUtil;
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;

/* JADX INFO: loaded from: classes.dex */
public class ArrayHeaderRedisMessage implements RedisMessage {
    private final long length;

    public ArrayHeaderRedisMessage(long j2) {
        if (j2 >= -1) {
            this.length = j2;
            return;
        }
        throw new RedisCodecException("length: " + j2 + " (expected: >= -1)");
    }

    public boolean isNull() {
        return this.length == -1;
    }

    public final long length() {
        return this.length;
    }

    public String toString() {
        return StringUtil.simpleClassName(this) + AbstractJsonLexerKt.BEGIN_LIST + "length=" + this.length + AbstractJsonLexerKt.END_LIST;
    }
}
