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

com.jparams.test.tostring.template.matcher.SimpleClassNameMatcher Maven / Gradle / Ivy

There is a newer version: 1.1.2
Show newest version
package com.jparams.test.tostring.template.matcher;

import com.jparams.test.tostring.subject.Subject;

public class SimpleClassNameMatcher implements Matcher
{
    @Override
    public String match(final String snippet, final Subject subject) throws MatcherException
    {
        final String className = subject.getType().getSimpleName();

        if (snippet.startsWith(className))
        {
            return className;
        }

        throw new MatcherException("Expected class name: " + className);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy