public ChangeSchemaFieldNamesCase()

in src/main/java/com/epam/eco/commons/avro/modification/ChangeSchemaFieldNamesCase.java [51:84]


    public ChangeSchemaFieldNamesCase(
            Case caze,
            Collection<String> includeRegexps,
            Collection<String> excludeRegexps) {
        Validate.notNull(caze, "Case is null");

        if (includeRegexps != null) {
            Validate.noNullElements(
                    includeRegexps,
                    "Collection of include regexps contains null elements");
        }
        if (excludeRegexps != null) {
            Validate.noNullElements(
                    excludeRegexps,
                    "Collection of exclude regexps contains null elements");
        }

        this.caze = caze;
        this.includeRegexps =
                includeRegexps != null ?
                Collections.unmodifiableList(new ArrayList<>(includeRegexps)) :
                Collections.emptyList();
        this.excludeRegexps =
                excludeRegexps != null ?
                Collections.unmodifiableList(new ArrayList<>(excludeRegexps)) :
                Collections.emptyList();

        includePatterns = this.includeRegexps.stream().
                map(Pattern::compile).
                collect(Collectors.toList());
        excludePatterns = this.excludeRegexps.stream().
                map(Pattern::compile).
                collect(Collectors.toList());
    }