package com.kofax.kmc.klo.logistics.data; import com.google.android.gms.measurement.api.AppMeasurementSdk; import com.kofax.kmc.klo.logistics.version.KloVersion; import com.kofax.kmc.kut.utilities.AppContextProvider; import com.kofax.kmc.kut.utilities.SdkVersion; import com.kofax.kmc.kut.utilities.error.ErrorInfo; import com.kofax.kmc.kut.utilities.error.InternalError; import com.kofax.kmc.kut.utilities.error.KmcRuntimeException; import com.kofax.kmc.kut.utilities.error.NullPointerException; import com.kofax.mobile.sdk._internal.IBus; import com.kofax.mobile.sdk._internal.dagger.Injector; import com.kofax.mobile.sdk._internal.k; import com.kofax.mobile.sdk.q.b; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; /* loaded from: classes3.dex */ public class Field implements Serializable, Cloneable { private static final String TAG = "Field"; private static final long serialVersionUID = 8609833668015011166L; private transient IBus _bus; private transient String iL; private transient FieldType iY; private transient String iZ; private transient Boolean ja; private transient String tag; private transient String value; /* renamed from: clone, reason: merged with bridge method [inline-methods] */ public Field m275clone() { try { return (Field) super.clone(); } catch (CloneNotSupportedException unused) { throw new InternalError("Field: unexpected clone not supported exception"); } } public Field(FieldType fieldType) { this.iY = null; this.value = new String(); this.iZ = new String(); this.tag = new String(); this.iL = ""; a(fieldType); } /* JADX INFO: Access modifiers changed from: package-private */ public Field(FieldType fieldType, String str) { this.iY = null; this.value = new String(); this.iZ = new String(); this.tag = new String(); this.iL = ""; a(fieldType); this.iL = str; } public FieldType getFieldType() { FieldType fieldType = this.iY; if (fieldType != null) { return fieldType.m276clone(); } return null; } public void setTag(String str) { a(str, "tag"); this.tag = str; } public void updateFieldProperties(String str, boolean z, String str2) { a(str, AppMeasurementSdk.ConditionalUserProperty.VALUE); a(str2, "errorDescription"); this.ja = Boolean.valueOf(z); this.iZ = str2; k(str); } private void a(FieldType fieldType) { this.value = ""; this.ja = Boolean.TRUE; this.iZ = ""; this.tag = ""; this.iY = fieldType.m276clone(); this._bus = Injector.getInjector(AppContextProvider.getContext()).getIBus(); } private void a(Object obj, String str) { if (obj == null) { StringBuilder sb = new StringBuilder(); sb.append(str); sb.append(" parameter is null"); throw new NullPointerException(sb.toString()); } if (!obj.getClass().getSimpleName().equals("Integer") || ((Integer) obj).intValue() >= 0) { return; } ErrorInfo errorInfo = ErrorInfo.KMC_GN_PARAM_NEGATIVE; StringBuilder sb2 = new StringBuilder("'"); sb2.append(str); sb2.append("' parameter is negative"); errorInfo.setErrCause(sb2.toString()); throw new KmcRuntimeException(errorInfo); } private void k(String str) { a(str, AppMeasurementSdk.ConditionalUserProperty.VALUE); k.c(TAG, "FieldChangedEvent::setValue"); String str2 = this.value; this.value = str; this._bus.post(new b(this.iL, this, str2)); } private void writeObject(ObjectOutputStream objectOutputStream) throws IOException { objectOutputStream.defaultWriteObject(); objectOutputStream.writeObject(Field.class.getName()); objectOutputStream.writeObject(KloVersion.getPackageVersion()); objectOutputStream.writeObject(this.iY); objectOutputStream.writeObject(this.iZ); objectOutputStream.writeObject(this.ja); objectOutputStream.writeObject(this.value); objectOutputStream.writeObject(this.tag); objectOutputStream.writeObject(this.iL); } private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException, KmcRuntimeException { objectInputStream.defaultReadObject(); if (Field.class.getName().compareToIgnoreCase((String) objectInputStream.readObject()) == 0) { if (SdkVersion.versionCompatible(KloVersion.getPackageVersion(), (String) objectInputStream.readObject()).booleanValue()) { this.iY = (FieldType) objectInputStream.readObject(); this.iZ = (String) objectInputStream.readObject(); this.ja = (Boolean) objectInputStream.readObject(); this.value = (String) objectInputStream.readObject(); this.tag = (String) objectInputStream.readObject(); this.iL = (String) objectInputStream.readObject(); return; } throw new KmcRuntimeException(ErrorInfo.KMC_GN_DESERIALIZE_VERSION_ERROR); } throw new KmcRuntimeException(ErrorInfo.KMC_GN_DESERIALIZE_OBJECT_ERROR); } public Boolean isValid() { return this.ja; } public String getValue() { return this.value; } public String getTag() { return this.tag; } public String getErrorDescription() { return this.iZ; } }