001/*
002 * Syncany, www.syncany.org
003 * Copyright (C) 2011-2016 Philipp C. Heckel <philipp.heckel@gmail.com>
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation, either version 3 of the License, or
008 * (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018package org.syncany.operations.update;
019
020import org.syncany.operations.OperationResult;
021
022/**
023 * Result class returned by the {@link UpdateOperation}. 
024 * 
025 * <p>If the operation was called with the 'check' action, an instance of
026 * this class will contain information about whether the operation
027 * was successful, and if it was, the available application information. 
028 * 
029 * @author Philipp C. Heckel (philipp.heckel@gmail.com)
030 */
031public class UpdateOperationResult implements OperationResult {
032        /**
033         * Result code of the update operation.
034         */
035        public enum UpdateResultCode {
036                OK, NOK
037        }
038
039        private UpdateResultCode resultCode;
040        private UpdateOperationAction action;
041
042        private AppInfo appInfo;
043        private boolean newVersionAvailable;
044
045        public UpdateOperationAction getAction() {
046                return action;
047        }
048
049        public void setAction(UpdateOperationAction action) {
050                this.action = action;
051        }
052
053        public UpdateResultCode getResultCode() {
054                return resultCode;
055        }
056
057        public void setResultCode(UpdateResultCode resultCode) {
058                this.resultCode = resultCode;
059        }
060
061        public AppInfo getAppInfo() {
062                return appInfo;
063        }
064
065        public void setAppInfo(AppInfo appInfo) {
066                this.appInfo = appInfo;
067        }
068
069        public boolean isNewVersionAvailable() {
070                return newVersionAvailable;
071        }
072
073        public void setNewVersionAvailable(boolean newVersionAvailable) {
074                this.newVersionAvailable = newVersionAvailable;
075        }
076}