// 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;
package com.github.levin81.daelic.druid.aggregator;


@JsonInclude(JsonInclude.Include.NON_NULL)
public class DoubleFirstAggregator implements Aggregator {

    private final String type = "doubleFirst";

    private String name;
    private String fieldName;

    DoubleFirstAggregator(String name, String fieldName) {
        Properties.assertRequired(name, "Name is a required property");
// 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/aggregator/DoubleFirstAggregator.java
import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.levin81.daelic.util.Properties;

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


@JsonInclude(JsonInclude.Include.NON_NULL)
public class DoubleFirstAggregator implements Aggregator {

    private final String type = "doubleFirst";

    private String name;
    private String fieldName;

    DoubleFirstAggregator(String name, String fieldName) {
        Properties.assertRequired(name, "Name is a required property");
        Properties.assertRequired(fieldName, "FieldName is a required property");