class GeneralTopologyObjectMapper {

    public GenericResourceApiServiceinformationServiceInformation buildServiceInformation(
            ServiceInstance serviceInstance, RequestContext requestContext, Customer customer,
            boolean includeModelInformation) {
        GenericResourceApiServiceinformationServiceInformation serviceInformation =
                new GenericResourceApiServiceinformationServiceInformation();
        serviceInformation.serviceId(serviceInstance.getServiceInstanceId());
        if (requestContext != null) {
            serviceInformation.setSubscriptionServiceType(requestContext.getProductFamilyId());
        }
        if (includeModelInformation) {
            GenericResourceApiOnapmodelinformationOnapModelInformation onapModelInformation =
                    new GenericResourceApiOnapmodelinformationOnapModelInformation();
            onapModelInformation
                    .setModelInvariantUuid(serviceInstance.getModelInfoServiceInstance().getModelInvariantUuid());
            onapModelInformation.setModelVersion(serviceInstance.getModelInfoServiceInstance().getModelVersion());
            onapModelInformation.setModelName(serviceInstance.getModelInfoServiceInstance().getModelName());
            onapModelInformation.setModelUuid(serviceInstance.getModelInfoServiceInstance().getModelUuid());
            serviceInformation.setOnapModelInformation(onapModelInformation);
        }
        serviceInformation.setServiceInstanceId(serviceInstance.getServiceInstanceId());

        if (customer != null) {
            serviceInformation.setGlobalCustomerId(customer.getGlobalCustomerId());
            if (customer.getServiceSubscription() != null) {
                serviceInformation.setSubscriptionServiceType(customer.getServiceSubscription().getServiceType());
            }

        }
        return serviceInformation;
    }

}