If a class has a collection data structure, maybe a hashmap etc, is it acceptable to use .get(id) within the class to access the collection, or should you write a method which calls the hashmap.get(id)?
I wasn’t sure if the getter is more for public access from outside requests?
Flip the question: Why wouldn’t you use the hashmap directly?
Ultimately, the answer depends on what you’re actually doing. There’s zero reason to write a method for getting hash values from inside your class unless you actually need to do something other than simply accessing hash values. Your class is the owner of the map–have your way with it.
If you expose the map to users of your class, the answer might be different.