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

crypto.analysis.errors.CallToError Maven / Gradle / Ivy

The newest version!
package crypto.analysis.errors;

import crypto.analysis.IAnalysisSeed;
import crysl.rule.CrySLMethod;
import crysl.rule.CrySLRule;
import java.util.Collection;
import java.util.Objects;

public class CallToError extends AbstractConstraintsError {

    private final Collection requiredMethods;

    public CallToError(
            IAnalysisSeed seed, CrySLRule rule, Collection requiredMethods) {
        super(seed, seed.getOrigin(), rule);

        this.requiredMethods = requiredMethods;
    }

    public Collection getRequiredMethods() {
        return requiredMethods;
    }

    @Override
    public String toErrorMarkerString() {
        return "Call to one of the methods "
                + formatMethodNames(requiredMethods)
                + getObjectType()
                + " is missing";
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), requiredMethods);
    }

    @Override
    public boolean equals(Object obj) {
        return super.equals(obj)
                && obj instanceof CallToError other
                && Objects.equals(requiredMethods, other.getRequiredMethods());
    }

    @Override
    public String toString() {
        return "CallToError: " + toErrorMarkerString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy