src/main/java/seedu/planner/model/ModelManager.java
private void removeAccommodationMapping(Accommodation acc) {
        if (acc.getContact().isPresent()) {
            Contact contact = getContact(acc.getContact().get()).get();
            if (contactActivityMap.containsKey(contact) && contactAccommodationMap.containsKey(contact)) {
                //if contact linked to both
                contactAccommodationMap.remove(contact);
            } else if (contactAccommodationMap.containsKey(contact) && !contactActivityMap.containsKey(contact)) {
                //if only linked to accommodation
                removeContact(contact);
            }
        }
    }
/**
     * Removes the mapping of an {@code Accommodation} in all the relevant {@code Contact} related {@code HashMap}.
     */
Removes the mapping of an  Accommodation in all the relevant  Contact related  HashMap.
Removes the mapping of an Accommodation in all the relevant Contact related HashMap .
private void removeAccommodationMapping(Accommodation acc) {
        if (acc.getContact().isPresent()) {
            Contact contact = getContact(acc.getContact().get()).get();
            if (contactActivityMap.containsKey(contact) && contactAccommodationMap.containsKey(contact)) {
                contactAccommodationMap.remove(contact);
            } else if (contactAccommodationMap.containsKey(contact) && !contactActivityMap.containsKey(contact)) {
                removeContact(contact);
            }
        }
    }
private void removeAccommodationMapping ( Accommodation acc ) { if ( acc . getContact ( ) . isPresent ( ) ) { Contact contact = getContact ( acc . getContact ( ) . get ( ) ) . get ( ) ; if ( contactActivityMap . containsKey ( contact ) && contactAccommodationMap . containsKey ( contact ) ) { contactAccommodationMap . remove ( contact ) ; } else if ( contactAccommodationMap . containsKey ( contact ) && ! contactActivityMap . containsKey ( contact ) ) { removeContact ( contact ) ; } } }
Removes the mapping of an {@code Accommodation} in all the relevant {@code Contact} related {@code HashMap}.
Removes the mapping of an { @code Accommodation } in all the relevant { @code Contact } related { @code HashMap } .
//if contact linked to both //if only linked to accommodation