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

com.jparams.test.tostring.template.matcher.WildcardMatcher 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 WildcardMatcher implements Matcher
{
    private final int length;

    public WildcardMatcher(final int length)
    {
        this.length = length;
    }

    @Override
    public String match(final String snippet, final Subject subject)
    {
        final int endIndex = snippet.length() < length ? snippet.length() : length;
        return snippet.substring(0, endIndex);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy