1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
// WARNING:  This file was autogenerated by jni-bindgen.  Any changes to this file may be lost!!!


__jni_bindgen! {
    /// public class [Semaphore](https://developer.android.com/reference/java/util/concurrent/Semaphore.html)
    ///
    /// Required feature: java-util-concurrent-Semaphore
    #[cfg(any(feature = "all", feature = "java-util-concurrent-Semaphore"))]
    public class Semaphore extends crate::java::lang::Object, implements crate::java::io::Serializable {

        /// <init>
        pub fn new_int<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: i32) -> __jni_bindgen::Result<__jni_bindgen::Local<'env, crate::java::util::concurrent::Semaphore>> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "<init>", .descriptor == "(I)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)];
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "<init>\0", "(I)V\0");
                __jni_env.new_object_a(__jni_class, __jni_method, __jni_args.as_ptr())
            }
        }

        /// <init>
        pub fn new_int_boolean<'env>(__jni_env: &'env __jni_bindgen::Env, arg0: i32, arg1: bool) -> __jni_bindgen::Result<__jni_bindgen::Local<'env, crate::java::util::concurrent::Semaphore>> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "<init>", .descriptor == "(IZ)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0), __jni_bindgen::AsJValue::as_jvalue(&arg1)];
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "<init>\0", "(IZ)V\0");
                __jni_env.new_object_a(__jni_class, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [acquire](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#acquire())
        pub fn acquire<'env>(&'env self) -> __jni_bindgen::Result<()> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "acquire", .descriptor == "()V"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "acquire\0", "()V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [acquireUninterruptibly](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#acquireUninterruptibly())
        pub fn acquire_uninterruptibly<'env>(&'env self) -> __jni_bindgen::Result<()> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "acquireUninterruptibly", .descriptor == "()V"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "acquireUninterruptibly\0", "()V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [tryAcquire](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#tryAcquire())
        pub fn try_acquire<'env>(&'env self) -> __jni_bindgen::Result<bool> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "tryAcquire", .descriptor == "()Z"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "tryAcquire\0", "()Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [tryAcquire](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#tryAcquire(long,%2520java,%2520util,%2520concurrent,%2520TimeUnit))
        ///
        /// Required features: "java-util-concurrent-TimeUnit"
        #[cfg(any(feature = "all", all(feature = "java-util-concurrent-TimeUnit")))]
        pub fn try_acquire_long_time_unit<'env>(&'env self, arg0: i64, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::util::concurrent::TimeUnit>>) -> __jni_bindgen::Result<bool> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "tryAcquire", .descriptor == "(JLjava/util/concurrent/TimeUnit;)Z"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0), __jni_bindgen::AsJValue::as_jvalue(&arg1.into())];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "tryAcquire\0", "(JLjava/util/concurrent/TimeUnit;)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [release](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#release())
        pub fn release<'env>(&'env self) -> __jni_bindgen::Result<()> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "release", .descriptor == "()V"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "release\0", "()V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [acquire](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#acquire(int))
        pub fn acquire_int<'env>(&'env self, arg0: i32) -> __jni_bindgen::Result<()> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "acquire", .descriptor == "(I)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "acquire\0", "(I)V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [acquireUninterruptibly](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#acquireUninterruptibly(int))
        pub fn acquire_uninterruptibly_int<'env>(&'env self, arg0: i32) -> __jni_bindgen::Result<()> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "acquireUninterruptibly", .descriptor == "(I)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "acquireUninterruptibly\0", "(I)V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [tryAcquire](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#tryAcquire(int))
        pub fn try_acquire_int<'env>(&'env self, arg0: i32) -> __jni_bindgen::Result<bool> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "tryAcquire", .descriptor == "(I)Z"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "tryAcquire\0", "(I)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [tryAcquire](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#tryAcquire(int,%2520long,%2520java,%2520util,%2520concurrent,%2520TimeUnit))
        ///
        /// Required features: "java-util-concurrent-TimeUnit"
        #[cfg(any(feature = "all", all(feature = "java-util-concurrent-TimeUnit")))]
        pub fn try_acquire_int_long_time_unit<'env>(&'env self, arg0: i32, arg1: i64, arg2: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::java::util::concurrent::TimeUnit>>) -> __jni_bindgen::Result<bool> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "tryAcquire", .descriptor == "(IJLjava/util/concurrent/TimeUnit;)Z"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0), __jni_bindgen::AsJValue::as_jvalue(&arg1), __jni_bindgen::AsJValue::as_jvalue(&arg2.into())];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "tryAcquire\0", "(IJLjava/util/concurrent/TimeUnit;)Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [release](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#release(int))
        pub fn release_int<'env>(&'env self, arg0: i32) -> __jni_bindgen::Result<()> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "release", .descriptor == "(I)V"
            unsafe {
                let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "release\0", "(I)V\0");
                __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [availablePermits](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#availablePermits())
        pub fn available_permits<'env>(&'env self) -> __jni_bindgen::Result<i32> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "availablePermits", .descriptor == "()I"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "availablePermits\0", "()I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [drainPermits](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#drainPermits())
        pub fn drain_permits<'env>(&'env self) -> __jni_bindgen::Result<i32> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "drainPermits", .descriptor == "()I"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "drainPermits\0", "()I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        // // Not emitting: Non-public method
        // /// [reducePermits](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#reducePermits(int))
        // fn reduce_permits<'env>(&'env self, arg0: i32) -> __jni_bindgen::Result<()> {
        //     // class.path == "java/util/concurrent/Semaphore", java.flags == PROTECTED, .name == "reducePermits", .descriptor == "(I)V"
        //     unsafe {
        //         let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0)];
        //         let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
        //         let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "reducePermits\0", "(I)V\0");
        //         __jni_env.call_void_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
        //     }
        // }

        /// [isFair](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#isFair())
        pub fn is_fair<'env>(&'env self) -> __jni_bindgen::Result<bool> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "isFair", .descriptor == "()Z"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "isFair\0", "()Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [hasQueuedThreads](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#hasQueuedThreads())
        pub fn has_queued_threads<'env>(&'env self) -> __jni_bindgen::Result<bool> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC | FINAL, .name == "hasQueuedThreads", .descriptor == "()Z"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "hasQueuedThreads\0", "()Z\0");
                __jni_env.call_boolean_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        /// [getQueueLength](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#getQueueLength())
        pub fn get_queue_length<'env>(&'env self) -> __jni_bindgen::Result<i32> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC | FINAL, .name == "getQueueLength", .descriptor == "()I"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "getQueueLength\0", "()I\0");
                __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }

        // // Not emitting: Non-public method
        // /// [getQueuedThreads](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#getQueuedThreads())
        // ///
        // /// Required features: "java-util-Collection"
        // #[cfg(any(feature = "all", all(feature = "java-util-Collection")))]
        // fn get_queued_threads<'env>(&'env self) -> __jni_bindgen::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::util::Collection>>> {
        //     // class.path == "java/util/concurrent/Semaphore", java.flags == PROTECTED, .name == "getQueuedThreads", .descriptor == "()Ljava/util/Collection;"
        //     unsafe {
        //         let __jni_args = [];
        //         let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
        //         let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "getQueuedThreads\0", "()Ljava/util/Collection;\0");
        //         __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
        //     }
        // }

        /// [toString](https://developer.android.com/reference/java/util/concurrent/Semaphore.html#toString())
        ///
        /// Required features: "java-lang-String"
        #[cfg(any(feature = "all", all(feature = "java-lang-String")))]
        pub fn to_string<'env>(&'env self) -> __jni_bindgen::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::lang::String>>> {
            // class.path == "java/util/concurrent/Semaphore", java.flags == PUBLIC, .name == "toString", .descriptor == "()Ljava/lang/String;"
            unsafe {
                let __jni_args = [];
                let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env);
                let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/Semaphore\0", "toString\0", "()Ljava/lang/String;\0");
                __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
            }
        }
    }
}