<commit_before>package com.t28.rxweather.data.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.t28.rxweather.util.CollectionUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@JsonDeserialize(builder = Forecast.Builder.class)
public class Forecast implements Model {
    private final City mCity;
    private final List<Weather> mWeathers;

    private Forecast(Builder builder) {
        mCity = builder.mCity;
        if (CollectionUtils.isEmpty(builder.mWeathers)) {
            mWeathers = Collections.emptyList();
        } else {
            mWeathers = new ArrayList<>(builder.mWeathers);
        }
    }

    @Override
    public String toString() {
        final StringBuilder builder = new StringBuilder();
        builder.append(Forecast.class.getSimpleName());

        try {
            final ObjectMapper mapper = new ObjectMapper();
            final String jsonString = mapper.writeValueAsString(this);
            builder.append(jsonString);
        } catch (JsonProcessingException e) {
            builder.append(hashCode());
        }

        return builder.toString();
    }

    @Override
    public boolean isValid() {
        if (mCity == null || !mCity.isValid()) {
            return false;
        }

        for (Weather weather : mWeathers) {
            if (weather.isValid()) {
                continue;
            }
            return false;
        }
        return true;
    }

    public City getCity() {
        return mCity;
    }

    public List<Weather> getWeathers() {
        return new ArrayList<>(mWeathers);
    }

    @JsonPOJOBuilder(withPrefix = "set")
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Builder {
        private City mCity;
        private final List<Weather> mWeathers;

        public Builder() {
            mWeathers = new ArrayList<>();
        }

        public Builder setCity(City city) {
            mCity = city;<commit_msg>不要なJacksonプロパティ削除<commit_after>package com.t28.rxweather.data.model;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.t28.rxweather.util.CollectionUtils;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Forecast implements Model {
    private final City mCity;
    private final List<Weather> mWeathers;

    private Forecast(Builder builder) {
        mCity = builder.mCity;
        if (CollectionUtils.isEmpty(builder.mWeathers)) {
            mWeathers = Collections.emptyList();
        } else {
            mWeathers = new ArrayList<>(builder.mWeathers);
        }
    }

    @Override
    public String toString() {
        final StringBuilder builder = new StringBuilder();
        builder.append(Forecast.class.getSimpleName());

        try {
            final ObjectMapper mapper = new ObjectMapper();
            final String jsonString = mapper.writeValueAsString(this);
            builder.append(jsonString);
        } catch (JsonProcessingException e) {
            builder.append(hashCode());
        }

        return builder.toString();
    }

    @Override
    public boolean isValid() {
        if (mCity == null || !mCity.isValid()) {
            return false;
        }

        for (Weather weather : mWeathers) {
            if (weather.isValid()) {
                continue;
            }
            return false;
        }
        return true;
    }

    public City getCity() {
        return mCity;
    }

    public List<Weather> getWeathers() {
        return new ArrayList<>(mWeathers);
    }

    public static class Builder {
        private City mCity;
        private final List<Weather> mWeathers;

        public Builder() {
            mWeathers = new ArrayList<>();
        }

        public Builder setCity(City city) {
            mCity = city;
{'fraction_non_alphanumeric': 0.09531853281853282, 'fraction_numerical': 0.0019305019305019305, 'mean_word_length': 2.310702875399361, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, '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': '5829698', 'n_tokens_mistral': 1141, 'n_tokens_neox': 1106, 'n_words': 253}