All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.mivek.model.trend.AbstractTafProbTrend Maven / Gradle / Ivy

package io.github.mivek.model.trend;

import io.github.mivek.enums.WeatherChangeType;
import io.github.mivek.internationalization.Messages;
import io.github.mivek.model.trend.validity.AbstractValidity;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * Class representing a weather change with a given probability.
 *
 * @param  a concrete subclass of {@link AbstractValidity}
 * @author f.loris
 */
public abstract class AbstractTafProbTrend extends AbstractTafTrend {

    /** Probability of the trend. */
    private Integer probability;

    /**
     * Constructor with parameter.
     *
     * @param pType the type to set.
     */
    protected AbstractTafProbTrend(final WeatherChangeType pType) {
        super(pType);
    }


    /**
     * @return the probability
     */
    public Integer getProbability() {
        return probability;
    }

    /**
     * @param pProbability the probability to set
     */
    public void setProbability(final Integer pProbability) {
        probability = pProbability;
    }

    /**
     * @return A description of the object.
     */
    @Override
    public String toString() {
        return new ToStringBuilder(this).
                appendSuper(super.toString()).
                append(Messages.getInstance().getString("ToString.probability"), probability).
                toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy