com.flextrade.jfixture.requests.GenericConstructorRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfixture Show documentation
Show all versions of jfixture Show documentation
JFixture is an open source library based on the popular .NET library, AutoFixture
The newest version!
package com.flextrade.jfixture.requests;
import com.flextrade.jfixture.utility.SpecimenType;
import java.lang.reflect.Constructor;
public class GenericConstructorRequest {
private final Constructor constructor;
private final SpecimenType containingType;
public GenericConstructorRequest(Constructor constructor, SpecimenType containingType) {
this.constructor = constructor;
this.containingType = containingType;
}
public Constructor getConstructor() {
return this.constructor;
}
public SpecimenType getContainingType() {
return this.containingType;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GenericConstructorRequest that = (GenericConstructorRequest) o;
return constructor.equals(that.constructor) && containingType.equals(that.containingType);
}
@Override
public int hashCode() {
int result = constructor.hashCode();
result = 31 * result + containingType.hashCode();
return result;
}
@Override
public String toString() {
return constructor.toString();
}
}