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

lowentry.ue4.classes.ParsedHashcash Maven / Gradle / Ivy

There is a newer version: 9.9.9.DELETED
Show newest version
package lowentry.ue4.classes;


import java.util.Date;


public class ParsedHashcash
{
	protected final boolean	valid;
	
	protected final String	resource;
	protected final Date	date;
	protected final int		bits;
	
	
	public ParsedHashcash(boolean valid, String resource, Date date, int bits)
	{
		this.valid = valid;
		
		this.resource = resource;
		this.date = date;
		this.bits = bits;
	}
	
	
	/**
	 * Returns true if this HashCash is valid, returns false if it is not valid.
	 */
	public boolean isValid()
	{
		return valid;
	}
	
	/**
	 * Returns the resource (basically the service ID) of this HashCash.
	 */
	public String getResource()
	{
		return resource;
	}
	
	/**
	 * Returns the creation date of this HashCash.
	 */
	public Date getDate()
	{
		return date;
	}
	
	/**
	 * Returns the bits (the strength, the value) of this HashCash.
	 */
	public int getBits()
	{
		return bits;
	}
	
	
	@Override
	public String toString()
	{
		if(!valid)
		{
			return getClass().getSimpleName() + "{invalid}";
		}
		return getClass().getSimpleName() + "{resource=\"" + resource + "\", date=\"" + date + "\", bits=" + bits + "}";
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy