diff options
author | Steven Moreland <smoreland@google.com> | 2018-01-05 09:41:10 -0800 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2018-01-05 19:13:06 +0000 |
commit | 4bfa2ebb89b909ac36094fd55080d749a996f5df (patch) | |
tree | bc4de3a6917fe02b9f02684e0328c49dd8df2430 /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | ae81e15c9cbfdc815a9b4e05d035cedabb6131a2 (diff) |
Generic Mutable class for HIDL code.
In general, using Mutable inside of structures
or as API arguments is a code smell. However, it
is the most syntactically clean way of fetching
something out of a lambda or inner class.
Using this, one can do:
Mutable<Result> res = new Mutable<>();
hidlObject.foo((...) -> {
res.value = ...;
});
There is an alternative:
Result a[] = new Result[1];
hidlObject.foo((...) -> {
a[0] = ...;
});
However, this alternative syntax is relatively messy.
Bug: N/A
Test: boot, use w/ wifi
Change-Id: Ibff13c653cc17bd25ddbb0534ba21ef485bff7aa
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions