src/main/java/seedu/address/logic/commands/EditCommand.java
/**
         * Returns a new EditStudySpotDescriptor, which updates the existing tags according to
         * the edit command provided.
         */
Returns a new EditStudySpotDescriptor, which updates the existing tags according to
the edit command provided.
Returns a new EditStudySpotDescriptor which updates the existing tags according to the edit command provided .
public EditStudySpotDescriptor updateTags(Set<Tag> existingTags) throws CommandException {
            boolean repeatedTagPresent = checkRepeatedField(addedTags, removedTags, FIELD_TAG);
            if (repeatedTagPresent) {
                throw new CommandException(MESSAGE_REPEATED_COMMANDS);
            }
            if (addedTags != null && addedTags.isEmpty()) {
                setTags(addedTags);
                return this;
            }
            if (removedTags != null && removedTags.isEmpty()) {
                throw new CommandException(MESSAGE_MISSING_REMOVAL_INPUT);
            }
            if (addedTags == null && removedTags == null && tags != null) {
                return this;
            }
            Set<Tag> updatedTags = existingTags;
            if (addedTags != null) {
                updatedTags = combineTagsAdded(addedTags, updatedTags);
            }
            if (removedTags != null) {
                updatedTags = combineTagsRemoved(removedTags, updatedTags);
            }
            setTags(updatedTags);
            return this;
        }
public EditStudySpotDescriptor updateTags ( Set < Tag > existingTags ) throws CommandException { boolean repeatedTagPresent = checkRepeatedField ( addedTags , removedTags , FIELD_TAG ) ; if ( repeatedTagPresent ) { throw new CommandException ( MESSAGE_REPEATED_COMMANDS ) ; } if ( addedTags != null && addedTags . isEmpty ( ) ) { setTags ( addedTags ) ; return this ; } if ( removedTags != null && removedTags . isEmpty ( ) ) { throw new CommandException ( MESSAGE_MISSING_REMOVAL_INPUT ) ; } if ( addedTags == null && removedTags == null && tags != null ) { return this ; } Set < Tag > updatedTags = existingTags ; if ( addedTags != null ) { updatedTags = combineTagsAdded ( addedTags , updatedTags ) ; } if ( removedTags != null ) { updatedTags = combineTagsRemoved ( removedTags , updatedTags ) ; } setTags ( updatedTags ) ; return this ; }
Returns a new EditStudySpotDescriptor, which updates the existing tags according to
 the edit command provided.
Returns a new EditStudySpotDescriptor which updates the existing tags according to the edit command provided .
// case where all tags are cleared // case where input to rt/ is empty // case where setTags() is already used without setAddedTags() and setRemovedTags()