boolean addObserver ( ApptentiveNotificationObserver observer , boolean useWeakReference ) { if ( observer == null ) { throw new IllegalArgumentException ( "Observer is null" ) ; } if ( ! contains ( observer ) ) { observers . add ( useWeakReference ? new ObserverWeakReference ( observer ) : observer ) ; return true ; } return false ; }
Adds an observer to the list without duplicates .