Class WordTranslator

java.lang.Object
lv.id.jc.piglatin.core.WordTranslator
All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>

@Component("wordTranslator") public class WordTranslator extends Object implements UnaryOperator<String>
This class is responsible for translating words to Pig Latin.
  • Constructor Details

    • WordTranslator

      public WordTranslator()
  • Method Details

    • apply

      public String apply(@Word String word)
      Translates a word to Pig Latin.
      Specified by:
      apply in interface Function<String,String>
      Parameters:
      word - the word to translate
      Returns:
      the translated word