class EnumPartition extends BasePartition implements JdbcFragmentMetadata {

    @Override
    public String toSqlConstraint(String quoteString, DbProduct dbProduct) {
        if (quoteString == null) {
            throw new RuntimeException("Quote string cannot be null");
        }

        StringBuilder sb = new StringBuilder();

        String quotedColumn = quoteString + column + quoteString;

        if (excluded == null) {
            sb.append(quotedColumn).append(" = '").append(value).append("'");
        } else {
            // We use inequality operator as it is the widest supported method
            sb.append("( ")
                    .append(Stream.of(excluded)
                            .map(excludedValue -> quotedColumn + " <> '" + excludedValue + "'")
                            .collect(Collectors.joining(" AND "))
                    ).append(" )");
        }

        return sb.toString();
    }

    public  EnumPartition(String column, String value);
    public  EnumPartition(String column, String[] excluded);

}