AddressController.java
@PutMapping("/{id}")
	@ApiOperation(value = "Updates a user specified address at the id passed", response = Address.class)
	@ApiResponses(value = {
			@ApiResponse(code = 200, message = "The updated address"),
			@ApiResponse(code = 400, message = "Address already exists"),
			@ApiResponse(code = 404, message = "Address not found"),
			@ApiResponse(code = 500, message = "Backend error")})
	public ResponseEntity updateAddress(@PathVariable int id, @RequestBody Address address) {
		try {
			Address updatedAddress = addressHelper.update(conn, id, address); //Updates an address at the given id
			if(updatedAddress.equals(address)) { //Makes sure the user passed address and the returned address are the same
				return new ResponseEntity<Address>(updatedAddress, HttpStatus.OK); //Returns the updated address
			}else {
				throw new AddressException(HttpStatus.NOT_FOUND,bundle.getString("address_not_found"));
			}
		}catch(AddressException e) {
			e.printStackTrace();
			return new ResponseEntity<String>(e.getMessage(), e.getHttp());
		}
	}
/**
	 * Updates a user specified address at the id passed
	 * @param id ID of the address to be updated
	 * @param address The new address to update the current address
	 * @return An address object
	 */
Updates a user specified address at the id passed
@param id ID of the address to be updated
@param address The new address to update the current address
@return An address object
Updates a user specified address at the id passed @param id ID of the address to be updated @param address The new address to update the current address @return An address object
@PutMapping("/{id}")
	@ApiOperation(value = "Updates a user specified address at the id passed", response = Address.class)
	@ApiResponses(value = {
			@ApiResponse(code = 200, message = "The updated address"),
			@ApiResponse(code = 400, message = "Address already exists"),
			@ApiResponse(code = 404, message = "Address not found"),
			@ApiResponse(code = 500, message = "Backend error")})
	public ResponseEntity updateAddress(@PathVariable int id, @RequestBody Address address) {
		try {
			Address updatedAddress = addressHelper.update(conn, id, address); 
			if(updatedAddress.equals(address)) { 
				return new ResponseEntity<Address>(updatedAddress, HttpStatus.OK); 
			}else {
				throw new AddressException(HttpStatus.NOT_FOUND,bundle.getString("address_not_found"));
			}
		}catch(AddressException e) {
			e.printStackTrace();
			return new ResponseEntity<String>(e.getMessage(), e.getHttp());
		}
	}
@ PutMapping ( "/{id}" ) @ ApiOperation ( value = "Updates a user specified address at the id passed" , response = Address . class ) @ ApiResponses ( value = { @ ApiResponse ( code = 200 , message = "The updated address" ) , @ ApiResponse ( code = 400 , message = "Address already exists" ) , @ ApiResponse ( code = 404 , message = "Address not found" ) , @ ApiResponse ( code = 500 , message = "Backend error" ) } ) public ResponseEntity updateAddress ( @ PathVariable int id , @ RequestBody Address address ) { try { Address updatedAddress = addressHelper . update ( conn , id , address ) ; if ( updatedAddress . equals ( address ) ) { return new ResponseEntity < Address > ( updatedAddress , HttpStatus . OK ) ; } else { throw new AddressException ( HttpStatus . NOT_FOUND , bundle . getString ( "address_not_found" ) ) ; } } catch ( AddressException e ) { e . printStackTrace ( ) ; return new ResponseEntity < String > ( e . getMessage ( ) , e . getHttp ( ) ) ; } }
Updates a user specified address at the id passed
 @param id ID of the address to be updated
 @param address The new address to update the current address
 @return An address object
Updates a user specified address at the id passed @param id ID of the address to be updated @param address The new address to update the current address @return An address object
//Updates an address at the given id //Makes sure the user passed address and the returned address are the same //Returns the updated address