Struct rust_jni::java::lang::Class[][src]

pub struct Class<'env> { /* fields omitted */ }

A type representing a Java Class.

Methods

impl<'env> Class<'env>
[src]

Find an existing Java class by it's name. The name is a fully qualified class or array type name.

JNI documentation

Define a new Java class from a .class file contents.

JNI documentation

Get the parent class of this class. Will return None for the Object class or any interface.

JNI documentation

Check if this class is a subtype of the other class.

In Java a class is a subtype of the other class if that other class is a direct or an indirect parent of this class or an interface this class or any it's parent is implementing.

JNI documentation

impl<'env> Class<'env>
[src]

Get the Java class object for Class .

Object::getClass javadoc

impl<'env> Class<'env>
[src]

Clone the Class . This is not a deep clone of the Java object, but a Rust-like clone of the value. Since Java objects are reference counted, this will increment the reference count.

This method has a different signature from the one in the Clone trait because cloning a Java object is only safe when there is no pending exception and because cloning a java object cat throw an exception.

JNI documentation

Convert the object to a string.

Object::toString javadoc

Methods from Deref<Target = Object<'env>>

Get the raw object pointer.

This function provides low-level access to the Java object and thus is unsafe.

Get the JniEnv this object is bound to.

Get the object's class.

JNI documentation

Compare with another Java object by reference.

JNI documentation

Check if the object is an instance of the class.

JNI documentation

Clone the Object. This is not a deep clone of the Java object, but a Rust-like clone of the value. Since Java objects are reference counted, this will increment the reference count.

This method has a different signature from the one in the Clone trait because cloning a Java object is only safe when there is no pending exception and because cloning a java object cat throw an exception.

JNI documentation

Convert the object to a string.

Object::toString javadoc

Compare to another Java object.

Object::equals

Trait Implementations

impl<'env> Debug for Class<'env>
[src]

Formats the value using the given formatter. Read more

impl<'a> JavaType for Class<'a>
[src]

Make Class mappable to jobject.

impl<'env> Cast<'env, Class<'env>> for Class<'env>
[src]

Make Class castable to itself.

Cast the object to itself or one of it's superclasses. Read more

impl<'env> Eq for Class<'env>
[src]

Allow comparing Class to Java objects. Java objects are compared by-reference to preserve original Java semantics. To compare objects by value, call the equals method.

Will panic if there is a pending exception in the current thread.

This is mostly a convenience for using assert_eq!() in tests. Always prefer using is_same_as to comparing with ==, because the former checks for a pending exception in compile-time rather than the run-time.

impl<'env> Deref for Class<'env>
[src]

Allow Class to be used in place of an Object.

The resulting type after dereferencing.

Dereferences the value.

impl<'env> Cast<'env, Object<'env>> for Class<'env>
[src]

Make Class castable to Object.

Cast the object to itself or one of it's superclasses. Read more

impl<'env, T> PartialEq<T> for Class<'env> where
    T: Cast<'env, Object<'env>>, 
[src]

Allow comparing Class to Java objects. Java objects are compared by-reference to preserve original Java semantics. To compare objects by value, call the equals method.

Will panic if there is a pending exception in the current thread.

This is mostly a convenience for using assert_eq!() in tests. Always prefer using is_same_as to comparing with ==, because the former checks for a pending exception in compile-time rather than the run-time.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<'env> Display for Class<'env>
[src]

Allow displaying Class .

Object::toString javadoc

This is mostly a convenience for debugging. Always prefer using to_string to printing the object as is, because the former checks for a pending exception in compile-time rather than the run-time.

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'env> !Send for Class<'env>

impl<'env> !Sync for Class<'env>