From e6a7960b8f3c838c66ef8cdaed5faf11a8d1ab26 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Fri, 10 Oct 2014 21:18:50 +0200 Subject: move delete into operation class --- .../keychain/operations/results/DeleteResult.java | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java new file mode 100644 index 000000000..1dce8f89e --- /dev/null +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/results/DeleteResult.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2014 Dominik Schürmann + * Copyright (C) 2014 Vincent Breitmoser + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.sufficientlysecure.keychain.operations.results; + +import android.os.Parcel; + +public class DeleteResult extends OperationResult { + + final public int mOk, mFail; + + public DeleteResult(int result, OperationLog log, int ok, int fail) { + super(result, log); + mOk = ok; + mFail = fail; + } + + /** Construct from a parcel - trivial because we have no extra data. */ + public DeleteResult(Parcel source) { + super(source); + mOk = source.readInt(); + mFail = source.readInt(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + super.writeToParcel(dest, flags); + dest.writeInt(mOk); + dest.writeInt(mFail); + } + + public static Creator CREATOR = new Creator() { + public DeleteResult createFromParcel(final Parcel source) { + return new DeleteResult(source); + } + + public DeleteResult[] newArray(final int size) { + return new DeleteResult[size]; + } + }; + +} -- cgit v1.2.3