File tree Expand file tree Collapse file tree
src/main/java/io/github/vbetsch/codecracker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,10 +12,6 @@ public char encryptChar(char character) {
1212 }
1313
1414 public String decryptWord (String string ) {
15- StringBuilder stringBuilder = new StringBuilder ();
16- for (char c : string .toCharArray ()) {
17- stringBuilder .append (decryptLetter (c ));
18- }
19- return stringBuilder .toString ();
15+ return cypher .decryptWord (string );
2016 }
2117}
Original file line number Diff line number Diff line change 11package io .github .vbetsch .codecracker ;
22
3- import java .util .HashMap ;
4- import java .util .Map ;
5-
6- import static java .util .Map .entry ;
7-
83public class Cypher {
94 private final TranslationDictionary dictionary = new TranslationDictionary ();
105
@@ -15,4 +10,12 @@ public char decryptLetter(char letter) {
1510 public char encryptChar (char character ) {
1611 return dictionary .getEncryptions ().get (character );
1712 }
13+
14+ public String decryptWord (String string ) {
15+ StringBuilder stringBuilder = new StringBuilder ();
16+ for (char c : string .toCharArray ()) {
17+ stringBuilder .append (decryptLetter (c ));
18+ }
19+ return stringBuilder .toString ();
20+ }
1821}
You can’t perform that action at this time.
0 commit comments