Chromium Code Reviews| 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; |
| + } |
| +} |