Package lv.id.jc.piglatin.core
Class PhraseTranslator
java.lang.Object
lv.id.jc.piglatin.core.PhraseTranslator
- All Implemented Interfaces:
Function<String,
,String> UnaryOperator<String>
@Component("phraseTranslator")
public class PhraseTranslator
extends Object
implements UnaryOperator<String>
The PhraseTranslator class translates a phrase to Pig Latin.
-
Constructor Summary
ConstructorDescriptionPhraseTranslator
(Function<String, Matcher> wordMatcher, UnaryOperator<String> wordTranslator) Constructs a new PhraseTranslator. -
Method Summary
-
Constructor Details
-
PhraseTranslator
public PhraseTranslator(Function<String, Matcher> wordMatcher, @Validated @Qualifier("wordTranslator") UnaryOperator<String> wordTranslator) Constructs a new PhraseTranslator.- Parameters:
wordMatcher
- a function that takes a string and returns a Matcher for words in the stringwordTranslator
- a function that takes a string and translates it to Pig Latin
-
-
Method Details