The open source OpenXR runtime
1// Copyright 2020-2021, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3// Author: Rylie Pavlik <rylie.pavlik@collabora.com>
4
5#pragma once
6
7#include "ObjectWrapperBase.h"
8
9namespace wrap {
10namespace java::util {
11/*!
12 * Wrapper for java.util.List objects.
13 */
14class List : public ObjectWrapperBase {
15 public:
16 using ObjectWrapperBase::ObjectWrapperBase;
17 static constexpr const char *getTypeName() noexcept {
18 return "java/util/List";
19 }
20
21 /*!
22 * Wrapper for the size method
23 *
24 * Java prototype:
25 * `public abstract int size();`
26 *
27 * JNI signature: ()I
28 *
29 */
30 int32_t size() const;
31
32 /*!
33 * Wrapper for the get method
34 *
35 * Java prototype:
36 * `public abstract E get(int);`
37 *
38 * JNI signature: (I)Ljava/lang/Object;
39 *
40 */
41 jni::Object get(int32_t index) const;
42
43 /*!
44 * Class metadata
45 */
46 struct Meta : public MetaBaseDroppable {
47 jni::method_t size;
48 jni::method_t get;
49
50 /*!
51 * Singleton accessor
52 */
53 static Meta &data() {
54 static Meta instance{};
55 return instance;
56 }
57
58 private:
59 Meta();
60 };
61};
62
63} // namespace java::util
64} // namespace wrap
65#include "java.util.impl.h"