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

base.jee.api.model.Throttle Maven / Gradle / Ivy

/**
 * Creative commons Attribution-NonCommercial license.
 *
 * http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB
 *
 * NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 */
package base.jee.api.model;

import base.QueryResult;
import base.json.Json;

import java.util.Date;

public class Throttle implements QueryResult {

	private String uid;
	private Date updated;
	private long attempts;

	public Throttle(String uid, Date updated, long attempts) {
		this.uid = uid;
		this.updated = updated;
		this.attempts = attempts;
	}

	public String getUid() {
		return uid;
	}

	public Date getUpdated() {
		return updated;
	}

	public long getAttempts() {
		return attempts;
	}

	public String toString() {
		return toJson();
	}

	@Override
	public String toJson() {
		return "{" +
				"\"uid\":\"" + Json.escape(uid) + "\"," +
				"\"updated\":\"" + Json.toDateTime(updated) + "\"," +
				"\"attempts\":" + attempts +
				"}";
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy