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

org.kohsuke.github.GHRepositoryTraffic Maven / Gradle / Ivy

There is a newer version: 2.0.0-alpha-2
Show newest version
package org.kohsuke.github;

import java.util.Date;
import java.util.List;

// TODO: Auto-generated Javadoc
/**
 * The type GHRepositoryTraffic.
 */
public abstract class GHRepositoryTraffic implements TrafficInfo {
    private int count;
    private int uniques;

    /**
     * Instantiates a new GH repository traffic.
     */
    GHRepositoryTraffic() {
    }

    /**
     * Instantiates a new GH repository traffic.
     *
     * @param count
     *            the count
     * @param uniques
     *            the uniques
     */
    GHRepositoryTraffic(int count, int uniques) {
        this.count = count;
        this.uniques = uniques;
    }

    /**
     * Gets the count.
     *
     * @return the count
     */
    public int getCount() {
        return count;
    }

    /**
     * Gets the uniques.
     *
     * @return the uniques
     */
    public int getUniques() {
        return uniques;
    }

    /**
     * Gets daily info.
     *
     * @return the daily info
     */
    public abstract List getDailyInfo();

    /**
     * The type DailyInfo.
     */
    public static abstract class DailyInfo implements TrafficInfo {
        private String timestamp;
        private int count;
        private int uniques;

        /**
         * Gets timestamp.
         *
         * @return the timestamp
         */
        public Date getTimestamp() {
            return GitHubClient.parseDate(timestamp);
        }

        /**
         * Gets the count.
         *
         * @return the count
         */
        public int getCount() {
            return count;
        }

        /**
         * Gets the uniques.
         *
         * @return the uniques
         */
        public int getUniques() {
            return uniques;
        }

        /**
         * Instantiates a new daily info.
         */
        DailyInfo() {
        }

        /**
         * Instantiates a new daily info.
         *
         * @param timestamp
         *            the timestamp
         * @param count
         *            the count
         * @param uniques
         *            the uniques
         */
        DailyInfo(String timestamp, Integer count, Integer uniques) {
            this.timestamp = timestamp;
            this.count = count;
            this.uniques = uniques;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy