<commit_before>package com.uwetrottmann.tmdb2.entities;

import com.uwetrottmann.tmdb2.enumerations.ReleaseType;

public class DiscoverFilter {

    private final Separator separator;
    private final Integer[] items;

    public enum Separator {
        AND(","), OR("|");

        private final String symbol;

        Separator(String symbol) {
            this.symbol = symbol;
        }
    }

    public DiscoverFilter(Integer... items) {
        this.separator = Separator.AND;
        this.items = items;
    }

    public DiscoverFilter(Separator separator, ReleaseType... types) {
        this.separator = separator;
        this.items = new Integer[types.length];
        for (int i = 0; i < types.length; i++) {
            ReleaseType type = types[i];
            if (type != null) {
                items[i] = type.id;
            }
        }
    }

    @Override
    public String toString() {
        if (items == null || items.length == 0) {
            return null;
        }

        StringBuilder sb = new StringBuilder();
        for (Integer item : items) {
            if (item == null) {
                continue;
            }
            if (sb.length() > 0) {
                sb.append(separator.symbol);
            }
            sb.append(item);
        }<commit_msg>Added alternative constructor to allow 'OR' as an operator choice.<commit_after>package com.uwetrottmann.tmdb2.entities;

import com.uwetrottmann.tmdb2.enumerations.ReleaseType;

public class DiscoverFilter {

    private final Separator separator;
    private final Integer[] items;

    public enum Separator {
        AND(","), OR("|");

        private final String symbol;

        Separator(String symbol) {
            this.symbol = symbol;
        }
    }

    public DiscoverFilter(Integer... items) {
        this.separator = Separator.AND;
        this.items = items;
    }

    public DiscoverFilter(Separator separator, Integer... items) {
        this.separator = separator;
        this.items = items;
    }

    public DiscoverFilter(Separator separator, ReleaseType... types) {
        this.separator = separator;
        this.items = new Integer[types.length];
        for (int i = 0; i < types.length; i++) {
            ReleaseType type = types[i];
            if (type != null) {
                items[i] = type.id;
            }
        }
    }

    @Override
    public String toString() {
        if (items == null || items.length == 0) {
            return null;
        }

        StringBuilder sb = new StringBuilder();
        for (Integer item : items) {
            if (item == null) {
                continue;
            }
            if (sb.length() > 0) {
                sb.append(separator.symbol);
            }
            sb.append(item);
        }
{'fraction_non_alphanumeric': 0.11023339317773788, 'fraction_numerical': 0.003590664272890485, 'mean_word_length': 1.6891891891891893, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6439915', 'n_tokens_mistral': 784, 'n_tokens_neox': 748, 'n_words': 194}