
io.magentys.utils.Any Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cherry Show documentation
Show all versions of cherry Show documentation
A syntactical sugar project for BDD oriented tests
package io.magentys.utils;
import static io.magentys.utils.Requires.requiresNotNull;
public class Any {
private final T t;
public Any(final T t){
this.t = requiresNotNull(t, "You cannot create 'Any' of a null value");
}
public static Any any(final T t) {
return new Any(t);
}
public T get(){
return t;
}
public boolean equals(final Object o){
if(o == null) return false;
if(o instanceof Any){
Any any = (Any) o;
if(any.get() == t) return true;
return any.get().equals(t);
}
else return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy