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

io.toolisticon.aptk.tools.matcher.impl.ByNumberOfParametersMatcher Maven / Gradle / Ivy

package io.toolisticon.aptk.tools.matcher.impl;

import io.toolisticon.aptk.tools.matcher.CriteriaMatcher;

import javax.lang.model.element.ExecutableElement;

public class ByNumberOfParametersMatcher implements CriteriaMatcher {

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean checkForMatchingCharacteristic(ExecutableElement element, Integer toCheckFor) {
        return (element != null && toCheckFor != null) && element.getParameters().size() == toCheckFor;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String getStringRepresentationOfPassedCharacteristic(Integer toGetStringRepresentationFor) {
        return toGetStringRepresentationFor != null ? toGetStringRepresentationFor.toString() : null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy