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

framework.src.org.checkerframework.framework.type.AnnotatedTypeParameterBounds Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java’s type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.42.0
Show newest version
package org.checkerframework.framework.type;

public class AnnotatedTypeParameterBounds {
    private final AnnotatedTypeMirror upper;
    private final AnnotatedTypeMirror lower;

    public AnnotatedTypeParameterBounds(AnnotatedTypeMirror upper, AnnotatedTypeMirror lower) {
        this.upper = upper;
        this.lower = lower;
    }

    public AnnotatedTypeMirror getUpperBound() {
        return upper;
    }

    public AnnotatedTypeMirror getLowerBound() {
        return lower;
    }

    @Override
    public String toString() {
        return "[extends " + upper + " super " + lower + "]";
    }

    @Override
    public int hashCode() {
        return 17 * upper.hashCode()
            + 37 * lower.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof AnnotatedTypeParameterBounds)) {
            return false;
        }
        AnnotatedTypeParameterBounds other = (AnnotatedTypeParameterBounds)obj;
        return this.upper == null ? other.upper == null : this.upper.equals(other.upper)
            && this.lower == null ? other.lower == null : this.lower.equals(other.lower);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy