com.geotab.model.serialization.SourceDeserializer Maven / Gradle / Ivy
/*
*
* 2020 Copyright (C) Geotab Inc. All rights reserved.
*/
package com.geotab.model.serialization;
import static com.geotab.model.entity.source.SourceAiModel.SOURCE_AI_MODEL_ID;
import static com.geotab.model.entity.source.SourceAiModelObsolete.SOURCE_AI_MODEL_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceBrp.SOURCE_BRP_ID;
import static com.geotab.model.entity.source.SourceBrpObsolete.SOURCE_BRP_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceGmccc.SOURCE_GMCCC_ID;
import static com.geotab.model.entity.source.SourceGmcccObsolete.SOURCE_GMCCC_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceGo.SOURCE_GEOTAB_GO_ID;
import static com.geotab.model.entity.source.SourceGoObsolete.GEOTAB_GO_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceJ1708.SOURCE_J1708_ID;
import static com.geotab.model.entity.source.SourceJ1708Obsolete.SOURCE_J1708_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceJ1939.SOURCE_J1939_ID;
import static com.geotab.model.entity.source.SourceJ1939Obsolete.SOURCE_J1939_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceLegacy.SOURCE_LEGACY_ID;
import static com.geotab.model.entity.source.SourceLegacyObsolete.SOURCE_LEGACY_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceObd.SOURCE_OBD_ID;
import static com.geotab.model.entity.source.SourceObdObsolete.SOURCE_OBD_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceObdSa.SOURCE_OBD_SA_ID;
import static com.geotab.model.entity.source.SourceObdSaObsolete.SOURCE_OBD_SA_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceProprietary.SOURCE_PROPRIETARY_ID;
import static com.geotab.model.entity.source.SourceProprietaryObsolete.SOURCE_PROPRIETARY_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceSystem.SOURCE_SYSTEM_ID;
import static com.geotab.model.entity.source.SourceSystemObsolete.SOURCE_SYSTEM_OBSOLETE_ID;
import static com.geotab.model.entity.source.SourceThirdParty.SOURCE_THIRD_PARTY_ID;
import static com.geotab.model.entity.source.SourceThirdPartyObsolete.SOURCE_THIRD_PARTY_OBSOLETE_ID;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import com.geotab.model.Id;
import com.geotab.model.entity.source.Source;
import com.geotab.model.entity.source.SourceAiModel;
import com.geotab.model.entity.source.SourceAiModelObsolete;
import com.geotab.model.entity.source.SourceBrp;
import com.geotab.model.entity.source.SourceBrpObsolete;
import com.geotab.model.entity.source.SourceGmccc;
import com.geotab.model.entity.source.SourceGmcccObsolete;
import com.geotab.model.entity.source.SourceGo;
import com.geotab.model.entity.source.SourceGoObsolete;
import com.geotab.model.entity.source.SourceJ1708;
import com.geotab.model.entity.source.SourceJ1708Obsolete;
import com.geotab.model.entity.source.SourceJ1939;
import com.geotab.model.entity.source.SourceJ1939Obsolete;
import com.geotab.model.entity.source.SourceLegacy;
import com.geotab.model.entity.source.SourceLegacyObsolete;
import com.geotab.model.entity.source.SourceObd;
import com.geotab.model.entity.source.SourceObdObsolete;
import com.geotab.model.entity.source.SourceObdSa;
import com.geotab.model.entity.source.SourceObdSaObsolete;
import com.geotab.model.entity.source.SourceProprietary;
import com.geotab.model.entity.source.SourceProprietaryObsolete;
import com.geotab.model.entity.source.SourceSystem;
import com.geotab.model.entity.source.SourceSystemObsolete;
import com.geotab.model.entity.source.SourceThirdParty;
import com.geotab.model.entity.source.SourceThirdPartyObsolete;
import java.io.IOException;
import org.apache.commons.lang3.StringUtils;
public class SourceDeserializer extends JsonDeserializer