app/src/main/java/com/mensa/zhmensa/services/MensaManager.java
/**
     * Adds a mensa to the IdToMensa Mapping and notifies all listeners
     * If a mensa allready exists, returns false
     * @param mensa The Mensa to add
     * @return true if mensa was added succesfully
     */
Adds a mensa to the IdToMensa Mapping and notifies all listeners
If a mensa allready exists, returns false
@param mensa The Mensa to add
@return true if mensa was added succesfully
Adds a mensa to the IdToMensa Mapping and notifies all listeners If a mensa allready exists returns false @param mensa The Mensa to add @return true if mensa was added succesfully
private static boolean put(@NonNull Mensa mensa, @SuppressWarnings("SameParameterValue") boolean notifyListener) {
        Mensa storedMensa = IdToMensaMapping.get(mensa.getUniqueId());
        if (storedMensa == null) {
            IdToMensaMapping.put(mensa.getUniqueId(), mensa);
            Log.d("MensaManager", "New mensa added: " + mensa.getDisplayName() + " triggering listener");
            if(notifyListener)
                listener.onNewMensaLoaded(Collections.singletonList(mensa));
            return true;
        } else if(notifyListener){
                listener.onMensaUpdated(mensa);
        }
        return false;
    }
private static boolean put ( @ NonNull Mensa mensa , @ SuppressWarnings ( "SameParameterValue" ) boolean notifyListener ) { Mensa storedMensa = IdToMensaMapping . get ( mensa . getUniqueId ( ) ) ; if ( storedMensa == null ) { IdToMensaMapping . put ( mensa . getUniqueId ( ) , mensa ) ; Log . d ( "MensaManager" , "New mensa added: " + mensa . getDisplayName ( ) + " triggering listener" ) ; if ( notifyListener ) listener . onNewMensaLoaded ( Collections . singletonList ( mensa ) ) ; return true ; } else if ( notifyListener ) { listener . onMensaUpdated ( mensa ) ; } return false ; }
Adds a mensa to the IdToMensa Mapping and notifies all listeners
 If a mensa allready exists, returns false
 @param mensa The Mensa to add
 @return true if mensa was added succesfully
Adds a mensa to the IdToMensa Mapping and notifies all listeners If a mensa allready exists returns false @param mensa The Mensa to add @return true if mensa was added succesfully
// New mensa was inserted