BicepBuddyApp/src/main/java/Matching/MatchController.java
public static void rejectMatch(Match match) {
		if(match.getId() == null) {
			String id = createMatch(match);
			match.setId(id);
		}
		Master.appLogger.info(":: Match rejected by " + UserController.getUser().toString() + " with " + 
				UserController.getInstance().onlyGetUserById(match.getOther()).toString());
		
		UserController uc = UserController.getInstance();
		
		//add to both rejected
		match.reject();
		
		// Save Status change to DB
		updateMatch(match);
		
		// User
		List<Match> matches = UserController.getUser().getAccepted();
		if (matches.contains(match)) {
			matches.remove(match);
			UserController.getUser().setAccepted(matches);
		}
		matches = UserController.getUser().getWaiting();
		if (matches.contains(match)) {
			matches.remove(match);
			UserController.getUser().setWaiting(matches);
		}
		matches = UserController.getUser().getRejected();
		matches.add(match);
		UserController.getUser().setRejected(matches);
		
		// Updating Array State for User
		uc.updateMatchedArrayState(uc.getUser());
		
		
		
		// Other User
		User other = UserController.getInstance().getUserById(match.getOther());
		matches = other.getAccepted();
		if (matches.contains(match)) {
			matches.remove(match);
			other.setWaiting(matches);
		}
		matches = other.getWaiting();
		if (matches.contains(match)) {
			matches.remove(match);
			other.setWaiting(matches);
		}
		matches = other.getRejected();
		matches.add(match);
		other.setRejected(matches);
		
		// Updating Array State for Other User
		uc.updateMatchedArrayState(other);
	}
/**
	 * Reject match.
	 *
	 * @param match the match
	 */
Reject match.
@param match the match
Reject match . @param match the match
public static void rejectMatch(Match match) {
		if(match.getId() == null) {
			String id = createMatch(match);
			match.setId(id);
		}
		Master.appLogger.info(":: Match rejected by " + UserController.getUser().toString() + " with " + 
				UserController.getInstance().onlyGetUserById(match.getOther()).toString());
		UserController uc = UserController.getInstance();
		match.reject();
		updateMatch(match);
		List<Match> matches = UserController.getUser().getAccepted();
		if (matches.contains(match)) {
			matches.remove(match);
			UserController.getUser().setAccepted(matches);
		}
		matches = UserController.getUser().getWaiting();
		if (matches.contains(match)) {
			matches.remove(match);
			UserController.getUser().setWaiting(matches);
		}
		matches = UserController.getUser().getRejected();
		matches.add(match);
		UserController.getUser().setRejected(matches);
		uc.updateMatchedArrayState(uc.getUser());
		User other = UserController.getInstance().getUserById(match.getOther());
		matches = other.getAccepted();
		if (matches.contains(match)) {
			matches.remove(match);
			other.setWaiting(matches);
		}
		matches = other.getWaiting();
		if (matches.contains(match)) {
			matches.remove(match);
			other.setWaiting(matches);
		}
		matches = other.getRejected();
		matches.add(match);
		other.setRejected(matches);
		uc.updateMatchedArrayState(other);
	}
public static void rejectMatch ( Match match ) { if ( match . getId ( ) == null ) { String id = createMatch ( match ) ; match . setId ( id ) ; } Master . appLogger . info ( ":: Match rejected by " + UserController . getUser ( ) . toString ( ) + " with " + UserController . getInstance ( ) . onlyGetUserById ( match . getOther ( ) ) . toString ( ) ) ; UserController uc = UserController . getInstance ( ) ; match . reject ( ) ; updateMatch ( match ) ; List < Match > matches = UserController . getUser ( ) . getAccepted ( ) ; if ( matches . contains ( match ) ) { matches . remove ( match ) ; UserController . getUser ( ) . setAccepted ( matches ) ; } matches = UserController . getUser ( ) . getWaiting ( ) ; if ( matches . contains ( match ) ) { matches . remove ( match ) ; UserController . getUser ( ) . setWaiting ( matches ) ; } matches = UserController . getUser ( ) . getRejected ( ) ; matches . add ( match ) ; UserController . getUser ( ) . setRejected ( matches ) ; uc . updateMatchedArrayState ( uc . getUser ( ) ) ; User other = UserController . getInstance ( ) . getUserById ( match . getOther ( ) ) ; matches = other . getAccepted ( ) ; if ( matches . contains ( match ) ) { matches . remove ( match ) ; other . setWaiting ( matches ) ; } matches = other . getWaiting ( ) ; if ( matches . contains ( match ) ) { matches . remove ( match ) ; other . setWaiting ( matches ) ; } matches = other . getRejected ( ) ; matches . add ( match ) ; other . setRejected ( matches ) ; uc . updateMatchedArrayState ( other ) ; }
Reject match.
Reject match .
//add to both rejected // Save Status change to DB // User // Updating Array State for User // Other User // Updating Array State for Other User