Skip to content

Commit

Permalink
h2kt - support set
Browse files Browse the repository at this point in the history
Summary: as title

Differential Revision: D54783575

fbshipit-source-id: 8dfe7b466d215e03cf7fe5ca495d949b88d63d2c
  • Loading branch information
(SWE@Signals) authored and facebook-github-bot committed Mar 13, 2024
1 parent 5587a7f commit 8862b32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cxx/fbjni/detail/Iterator-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@ local_ref<JArrayList<E>> JArrayList<E>::create(int initialCapacity) {
return JArrayList<E>::newInstance(initialCapacity);
}

template <typename E>
local_ref<JHashSet<E>> JHashSet<E>::create() {
return JHashSet<E>::newInstance();
}

template <typename E>
local_ref<JHashSet<E>> JHashSet<E>::create(int initialCapacity) {
return JHashSet<E>::newInstance(initialCapacity);
}

template <typename K, typename V>
local_ref<JHashMap<K, V>> JHashMap<K, V>::create() {
return JHashMap<K, V>::newInstance();
Expand Down
8 changes: 8 additions & 0 deletions cxx/fbjni/detail/Iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ struct JArrayList : JavaClass<JArrayList<E>, JList<E>> {
static local_ref<JArrayList<E>> create(int initialCapacity);
};

template <typename E = jobject>
struct JHashSet : JavaClass<JHashSet<E>, JSet<E>> {
constexpr static auto kJavaDescriptor = "Ljava/util/HashSet;";

static local_ref<JHashSet<E>> create();
static local_ref<JHashSet<E>> create(int initialCapacity);
};

template <typename K = jobject, typename V = jobject>
struct JHashMap : JavaClass<JHashMap<K, V>, JMap<K, V>> {
constexpr static auto kJavaDescriptor = "Ljava/util/HashMap;";
Expand Down

0 comments on commit 8862b32

Please sign in to comment.