I'm new to programming, so this could be a complete oversight on my part. But I can confirm (down below) that the two values in the If tag are equivalent, but it is not returning my value.
public static LANGUAGESTRING toLangString(String text) {
for (LANGUAGESTRING lang : LANGUAGESTRING.values()) {
String langStr = lang.toString();
System.out.println(langStr);
System.out.println(text);
if (text == langStr) {
return lang;
}
}
return null;
}
Here is what was printed out. This is not my entire LANGUAGESTRING enum, but you can get the point from here. It should return the languagestring, right? Seeing as how the 5th and 6th line are the same? And even if it was returning it, it would break the loop, right?
[14:41:45] GodToBelieverPrayerWhenNoItemNeed
[14:41:45] GodToBelieverPrayingWeak
[14:41:45] GodToBelieverPrayerTooSoon
[14:41:45] GodToBelieverPrayingWeak
[14:41:45] GodToBelieverPrayingWeak
[14:41:45] GodToBelieverPrayingWeak
[14:41:45] EnterHolyLandInfoYourGod
[14:41:45] GodToBelieverPrayingWeak