package com.google.android.gms.maps.model; import android.os.Parcel; import android.os.Parcelable; import com.google.android.gms.common.internal.Objects; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable; import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter; import java.util.ArrayList; import java.util.List; /* loaded from: classes2.dex */ public class PatternItem extends AbstractSafeParcelable { public static final Parcelable.Creator CREATOR = new zzi(); private static final String TAG = "PatternItem"; private final int type; private final Float zzdv; public PatternItem(int i, Float f) { boolean z = true; if (i != 1 && (f == null || f.floatValue() < BitmapDescriptorFactory.HUE_RED)) { z = false; } String valueOf = String.valueOf(f); StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 45); sb.append("Invalid PatternItem: type="); sb.append(i); sb.append(" length="); sb.append(valueOf); Preconditions.checkArgument(z, sb.toString()); this.type = i; this.zzdv = f; } @Override // android.os.Parcelable public void writeToParcel(Parcel parcel, int i) { int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel); SafeParcelWriter.writeInt(parcel, 2, this.type); SafeParcelWriter.writeFloatObject(parcel, 3, this.zzdv, false); SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader); } public int hashCode() { int i = this.type; return Objects.hashCode(Integer.valueOf(i), this.zzdv); } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof PatternItem)) { return false; } PatternItem patternItem = (PatternItem) obj; return this.type == patternItem.type && Objects.equal(this.zzdv, patternItem.zzdv); } public String toString() { int i = this.type; String valueOf = String.valueOf(this.zzdv); StringBuilder sb = new StringBuilder(String.valueOf(valueOf).length() + 39); sb.append("[PatternItem: type="); sb.append(i); sb.append(" length="); sb.append(valueOf); sb.append("]"); return sb.toString(); } /* JADX INFO: Access modifiers changed from: package-private */ public static List zza(List list) { PatternItem dash; if (list == null) { return null; } ArrayList arrayList = new ArrayList(list.size()); for (PatternItem patternItem : list) { if (patternItem == null) { patternItem = null; } else { int i = patternItem.type; if (i == 0) { dash = new Dash(patternItem.zzdv.floatValue()); } else if (i == 1) { patternItem = new Dot(); } else if (i == 2) { dash = new Gap(patternItem.zzdv.floatValue()); } patternItem = dash; } arrayList.add(patternItem); } return arrayList; } }