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

com.softicar.platform.common.io.resource.hash.ResourceHash Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.io.resource.hash;

import com.softicar.platform.common.core.utils.CastUtils;
import com.softicar.platform.common.io.resource.IResource;

/**
 * A hash of the content of an {@link IResource}.
 *
 * @author Oliver Richers
 */
public class ResourceHash {

	private final String hash;

	public ResourceHash(String hash) {

		this.hash = hash.toLowerCase();
	}

	@Override
	public boolean equals(Object object) {

		return CastUtils//
			.tryCast(object, ResourceHash.class)
			.map(other -> other.hash.equals(hash))
			.orElse(false);
	}

	@Override
	public int hashCode() {

		return hash.hashCode();
	}

	@Override
	public String toString() {

		return hash.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy