FeatureMatcher.java

  1. /**
  2.  * Powerunit - A JDK1.8 test framework
  3.  * Copyright (C) 2014 Mathieu Boretti.
  4.  *
  5.  * This file is part of Powerunit
  6.  *
  7.  * Powerunit is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation, either version 3 of the License, or
  10.  * (at your option) any later version.
  11.  *
  12.  * Powerunit is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with Powerunit. If not, see <http://www.gnu.org/licenses/>.
  19.  */
  20. package ch.powerunit.extensions.matchers.provideprocessor.helper;

  21. import static java.lang.String.format;

  22. import ch.powerunit.extensions.matchers.common.RessourceLoaderHelper;

  23. public final class FeatureMatcher {

  24.     private static final String MATCHER_FORMAT = RessourceLoaderHelper.loadRessource(FeatureMatcher.class,
  25.             "FeatureMatcher.txt");

  26.     private final String matcher;

  27.     public FeatureMatcher(String prefix, String genericOnTargetMatcher, String matcherOverClass,
  28.             String genericOnMatcherOverClass, String targetObject, String matcherDescription, String accessor) {
  29.         matcher = format(MATCHER_FORMAT, prefix, genericOnTargetMatcher, matcherOverClass, genericOnMatcherOverClass,
  30.                 targetObject, matcherDescription, accessor);
  31.     }

  32.     public String toString() {
  33.         return matcher;
  34.     }

  35. }