class Schema {

    private Schema(Builder builder) {
        this.fieldNames = builder.fields.stream().map(Field::name).collect(toList());
        this.fields = ImmutableList.copyOf(builder.fields);
        this.optionalFields = ImmutableSet.copyOf(builder.optionalFields);
        this.constraints = ImmutableList.copyOf(builder.constraints);
        this.ignore = builder.pass;
        this.name = builder.name.length() > 0 ? builder.name : String.join(", ", this.fieldNames);
    }

    private  Schema(Builder builder);

}