package ca.canadapost.core.data.moshi.adapters;

import ea.a;
import java.util.Date;
import km.f;
import km.v;
import kotlin.Metadata;
import qa.b;

@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0000\u0018\u0000 \n2\u00020\u0001:\u0001\nB\u0007¢\u0006\u0004\b\b\u0010\tJ\u0014\u0010\u0005\u001a\u0004\u0018\u00010\u00042\b\u0010\u0003\u001a\u0004\u0018\u00010\u0002H\u0007J\u0014\u0010\u0007\u001a\u0004\u0018\u00010\u00022\b\u0010\u0006\u001a\u0004\u0018\u00010\u0004H\u0007¨\u0006\u000b"}, d2 = {"Lca/canadapost/core/data/moshi/adapters/CpDateAdapter;", "", "", "date", "Lea/a;", "fromJson", "cpdate", "toJson", "<init>", "()V", "a", "core_data_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes.dex */
public final class CpDateAdapter {
    @f
    public final a fromJson(String date) {
        Date a10;
        if (date == null || (a10 = b.a(date, "yyyy-MM-dd")) == null) {
            return null;
        }
        return new a(a10);
    }

    @v
    public final String toJson(a cpdate) {
        Date a10;
        if (cpdate == null || (a10 = cpdate.a()) == null) {
            return null;
        }
        return b.b(a10, "yyyy-MM-dd");
    }
}
