Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: mojo/public/java/system/src/org/chromium/mojo/system/ResultAnd.java

Issue 1057213003: Java: Introduce ResultAnd<> and use it. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/java/system/src/org/chromium/mojo/system/MessagePipeHandle.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/java/system/src/org/chromium/mojo/system/ResultAnd.java
diff --git a/mojo/public/java/system/src/org/chromium/mojo/system/ResultAnd.java b/mojo/public/java/system/src/org/chromium/mojo/system/ResultAnd.java
new file mode 100644
index 0000000000000000000000000000000000000000..656d0d64e49f49c8478a9bb8e70394cf20693000
--- /dev/null
+++ b/mojo/public/java/system/src/org/chromium/mojo/system/ResultAnd.java
@@ -0,0 +1,34 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.mojo.system;
+
+/**
+ * Container that contains a mojo result and a value.
+ *
+ * @param <A> the type of the value.
+ */
+public class ResultAnd<A> {
etiennej 2015/04/03 14:18:20 (very optional) Something I've seen sometimes in t
qsr 2015/04/03 14:32:54 This class is sometimes used even when the result
+ private final int mMojoResult;
+ private final A mValue;
+
+ public ResultAnd(int result, A value) {
+ this.mMojoResult = result;
+ this.mValue = value;
+ }
+
+ /**
+ * Returns the mojo result.
+ */
+ public int getMojoResult() {
+ return mMojoResult;
+ }
+
+ /**
+ * Returns the value.
+ */
+ public A getValue() {
+ return mValue;
+ }
+}
« no previous file with comments | « mojo/public/java/system/src/org/chromium/mojo/system/MessagePipeHandle.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698