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

io.kestra.plugin.gcp.LoadCsvValidator Maven / Gradle / Ivy

There is a newer version: 0.21.2
Show newest version
package io.kestra.plugin.gcp;

import io.kestra.plugin.gcp.bigquery.AbstractLoad;
import io.kestra.plugin.gcp.bigquery.LoadCsvValidation;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class LoadCsvValidator implements ConstraintValidator {

    @Override
    public boolean isValid(AbstractLoad value, ConstraintValidatorContext context) {
        if (value == null) {
            return true; // nulls are allowed according to spec
        }

        if (value.getFormat() == AbstractLoad.Format.CSV && value.getCsvOptions() == null) {
            return false;
        }

        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy