private boolean validateMandatoryFields(LoadBalancer loadBalancer) {
        boolean isMandatoryFieldsExists = true;
        if (LBType.getByProvider(loadBalancer.getProvider()) == LBType.ISTIO) {
            isMandatoryFieldsExists = validateEachField(loadBalancer.getLabels(), ValidatorActivity.LB_GATEWAY_LABEL_REQUIRED);
        }
        if (!validateEachField(loadBalancer.getHost(), ValidatorActivity.LB_HOST_REQUIRED) ||
                !validateEachField(loadBalancer.getProvider(), ValidatorActivity.LB_PROVIDER_REQUIRED) ||
                !validateEachField(loadBalancer.getMapping(), ValidatorActivity.LB_MAPPING_REQUIRED)) {
            isMandatoryFieldsExists = false;
        }
        if (loadBalancer.getMapping() != null && !loadBalancer.getMapping().isEmpty()) {
            boolean isMappingFieldsExists = validateLoadBalancerMapping(loadBalancer.getMapping());
            isMandatoryFieldsExists = isMappingFieldsExists && isMandatoryFieldsExists;
        }
        return isMandatoryFieldsExists;
    }
Checks for the required mandatory fields.
@param loadBalancer
workflow-controller/controller-service/src/main/java/io/hyscale/controller/validator/impl/LoadBalancerValidator.java