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

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.t28.rxweather.request.WeatherRequest;
import com.t28.rxweather.util.CollectionUtils;
import com.t28.rxweather.volley.RxSupport;

import java.util.Map;

import rx.Observable;

@JsonDeserialize(builder = Weather.Builder.class)
public class Weather implements Model {
    public static final long NO_TIME = 0;

    private final long mSunriseTime;
    private final long mSunsetTime;

    private final MainAttribute mAttribute;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private final City mCity;

    private Weather(Builder builder) {
        mSunriseTime = builder.mSunriseTime;
        mSunsetTime = builder.mSunsetTime;

        mAttribute = builder.mAttribute;

        final City city = new City.Builder()
                .setId(builder.mCityId)
                .setName(builder.mCityName)
                .setCountryCode(builder.mCountryCode)
                .setCoordinate(builder.mCoordinate)
                .build();
        if (city.isEmpty()) {
            mCity = null;
        } else {
            mCity = city;
        }
    }

    @Override
    public boolean isValid() {
        if (mSunriseTime < NO_TIME || mSunsetTime < NO_TIME) {
            return false;
        }

        if (mAttribute == null || !mAttribute.isValid()) {
            return false;
        }

        if (mCity == null) {
            return false;
        }
        return mCity.isValid();
    }

    public long getSunriseTime() {
        return mSunriseTime;
    }

    public long getSunsetTime() {
        return mSunsetTime;
    }

    public City getCity() {
        return mCity;
    }

    public MainAttribute getAttribute() {
        return mAttribute;
    }<commit_msg>Cityの検証を空の場合とそれ以外で分木<commit_after>package com.t28.rxweather.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import com.t28.rxweather.request.WeatherRequest;
import com.t28.rxweather.util.CollectionUtils;
import com.t28.rxweather.volley.RxSupport;

import java.util.Map;

import rx.Observable;

@JsonDeserialize(builder = Weather.Builder.class)
public class Weather implements Model {
    public static final long NO_TIME = 0;

    private final long mSunriseTime;
    private final long mSunsetTime;

    private final MainAttribute mAttribute;

    private final City mCity;

    private Weather(Builder builder) {
        mSunriseTime = builder.mSunriseTime;
        mSunsetTime = builder.mSunsetTime;

        mAttribute = builder.mAttribute;

        mCity = new City.Builder()
                .setId(builder.mCityId)
                .setName(builder.mCityName)
                .setCountryCode(builder.mCountryCode)
                .setCoordinate(builder.mCoordinate)
                .build();
    }

    @Override
    public boolean isValid() {
        if (mSunriseTime < NO_TIME || mSunsetTime < NO_TIME) {
            return false;
        }

        if (mAttribute == null || !mAttribute.isValid()) {
            return false;
        }

        if (mCity.isEmpty()) {
            return true;
        }
        return mCity.isValid();
    }

    public boolean hasCity() {
        return mCity.isEmpty();
    }

    public long getSunriseTime() {
        return mSunriseTime;
    }

    public long getSunsetTime() {
        return mSunsetTime;
    }

    public City getCity() {
        return mCity;
    }

    public MainAttribute getAttribute() {
        return mAttribute;
    }
{'fraction_non_alphanumeric': 0.08777270421106037, 'fraction_numerical': 0.0045662100456621, 'mean_word_length': 2.4648506151142353, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, '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': '411940', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1108, 'n_words': 236}