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

com.danielflower.crickam.scorer.Series Maven / Gradle / Ivy

There is a newer version: 0.11.3
Show newest version
package com.danielflower.crickam.scorer;

import static java.util.Objects.requireNonNull;

/**
 * The series that a match is part of
 */
public final class Series {

	private final String id;
	private final ImmutableList teams;
	private final String name;

	private Series(String id, ImmutableList teams, String name) {
        this.id = requireNonNull(id);
        this.teams = requireNonNull(teams);
        this.name = requireNonNull(name);
    }

    public String id() {
        return id;
    }

    public ImmutableList teams() {
        return teams;
    }

    public String name() {
        return name;
    }

    public static Builder series() {
        return new Builder();
    }

    public static final class Builder {
        public String id;
        public ImmutableList teams;
        public String name;

        public Builder withId(String id) {
            this.id = id;
            return this;
        }

        public Builder withTeams(ImmutableList teams) {
            this.teams = teams;
            return this;
        }

        public Builder withName(String name) {
            this.name = name;
            return this;
        }

        public Series build() {
            return new Series(id, teams, name);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy