How to annotate two Strings as different types & throw compile error
05:55 24 Feb 2026

I have two types of String that I don't want to cross wires in any way whatsoever.

@EntryID String entryID = "asdfasdf";
@UserID String userID = "asdf2asdf2";

How do I make sure that IntelliJ and/or Java throws compile errors if I ever do something like:

entryID.contentEquals(userID)
java intellij-idea