// Path: src/main/java/com/github/levin81/daelic/util/Properties.java
// public final class Properties {
// 
//     private Properties() {
// 
//     }
// 
//     public static <T> void assertRequired(T property, String errorMessage) {
//         if (property == null) {
//             throw new RequiredPropertyException(errorMessage);
//         }
//     }
// 
//     public static <T, E> void assertRequiredDependency(T property, E dependency, String errorMessage) {
//         if (property != null && dependency == null) {
//             throw new RequiredPropertyException(errorMessage);
//         }
//     }
// 
//     public static <T> void assertValid(T property, Function<T, Boolean> booleanExpression, String errorMessage) {
//         if (!booleanExpression.apply(property)) {
//             throw new InvalidPropertyException(errorMessage);
//         }
//     }
// }


import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.levin81.daelic.util.Properties;
import java.util.ArrayList;
import java.util.List;
package com.github.levin81.daelic.druid.datasource;



/***
 * This data source unions two or more table data sources.
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UnionDataSource implements DataSource {

    private final String type = "union";

    private List<DataSource> dataSources;

    UnionDataSource(List<DataSource> dataSources) {
        Properties.assertRequired(dataSources, "DataSources is a required property");

        this.dataSources = dataSources;
    }

    @Override
    public String getType() {
        return type;
    }

    public List<DataSource> getDataSources() {
        return dataSources;
    }

    public static UnionDataSourceBuilder builder() {
// Path: src/main/java/com/github/levin81/daelic/util/Properties.java
// public final class Properties {
// 
//     private Properties() {
// 
//     }
// 
//     public static <T> void assertRequired(T property, String errorMessage) {
//         if (property == null) {
//             throw new RequiredPropertyException(errorMessage);
//         }
//     }
// 
//     public static <T, E> void assertRequiredDependency(T property, E dependency, String errorMessage) {
//         if (property != null && dependency == null) {
//             throw new RequiredPropertyException(errorMessage);
//         }
//     }
// 
//     public static <T> void assertValid(T property, Function<T, Boolean> booleanExpression, String errorMessage) {
//         if (!booleanExpression.apply(property)) {
//             throw new InvalidPropertyException(errorMessage);
//         }
//     }
// }


// Path: src/main/java/com/github/levin81/daelic/druid/datasource/UnionDataSource.java
import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.levin81.daelic.util.Properties;
import java.util.ArrayList;
import java.util.List;

package com.github.levin81.daelic.druid.datasource;



/***
 * This data source unions two or more table data sources.
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UnionDataSource implements DataSource {

    private final String type = "union";

    private List<DataSource> dataSources;

    UnionDataSource(List<DataSource> dataSources) {
        Properties.assertRequired(dataSources, "DataSources is a required property");

        this.dataSources = dataSources;
    }

    @Override
    public String getType() {
        return type;
    }

    public List<DataSource> getDataSources() {
        return dataSources;
    }

    public static UnionDataSourceBuilder builder() {
        return new UnionDataSourceBuilder();