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

org.mapstruct.ap.internal.model.MethodReferencePresenceCheck Maven / Gradle / Ivy

/*
 * Copyright MapStruct Authors.
 *
 * Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
 */
package org.mapstruct.ap.internal.model;

import java.util.Objects;
import java.util.Set;

import org.mapstruct.ap.internal.model.common.ModelElement;
import org.mapstruct.ap.internal.model.common.PresenceCheck;
import org.mapstruct.ap.internal.model.common.Type;

/**
 * @author Filip Hrisafov
 */
public class MethodReferencePresenceCheck extends ModelElement implements PresenceCheck {

    protected final MethodReference methodReference;

    public MethodReferencePresenceCheck(MethodReference methodReference) {
        this.methodReference = methodReference;
    }

    @Override
    public Set getImportTypes() {
        return methodReference.getImportTypes();
    }

    public MethodReference getMethodReference() {
        return methodReference;
    }

    @Override
    public boolean equals(Object o) {
        if ( this == o ) {
            return true;
        }
        if ( o == null || getClass() != o.getClass() ) {
            return false;
        }
        MethodReferencePresenceCheck that = (MethodReferencePresenceCheck) o;
        return Objects.equals( methodReference, that.methodReference );
    }

    @Override
    public int hashCode() {
        return Objects.hash( methodReference );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy