All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ibm.fhir.audit.mapper.MapperFactory Maven / Gradle / Ivy

There is a newer version: 4.11.1
Show newest version
/*
 * (C) Copyright IBM Corp. 2020
 *
 * SPDX-License-Identifier: Apache-2.0
 */
package com.ibm.fhir.audit.mapper;

import java.util.Objects;

import com.ibm.fhir.audit.mapper.impl.AuditEventMapper;
import com.ibm.fhir.audit.mapper.impl.CADFMapper;

/**
 * Mapper Factory selects the desired mapper and returns a new instance
 * for each call.
 */
public final class MapperFactory {

    private MapperFactory() {
        // No Operation
    }

    /**
     * gets the appropriate mapper
     *
     * @param mt
     * @return
     * @throws IllegalArgumentException
     */
    public static Mapper getMapper(MapperType mt) {
        if (Objects.isNull(mt)) {
            throw new IllegalArgumentException("Expected non-null MapperType");
        }
        switch (mt) {
        case AUDITEVENT:
            return new AuditEventMapper();
        default:
            // The default is CADF
            return new CADFMapper();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy