Skip to content

Commit

Permalink
Merge branch 'nested_class_readme' of github.com:rukai/j4rs into ruka…
Browse files Browse the repository at this point in the history
…i-nested_class_readme
  • Loading branch information
astonbitecode committed Mar 15, 2024
2 parents c2b4c02 + fc8d642 commit 3911e14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ let system_out_field = jvm.field(&system_class, "out");
// Retrieve an enum constant using the field
let access_mode_enum = jvm.static_class("java.nio.file.AccessMode")?;
let access_mode_write = jvm.field(&access_mode_enum, "WRITE")?;

// Retrieve a nested class (note the use of `$` instead of `.`)
let state = jvm.static_class("java.lang.Thread$State")?;
```

`Instances`s of Java `List`s and `Map`s can be created with the `java_list` and `java_map` functions:
Expand Down
3 changes: 3 additions & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ let system_out_field = jvm.field(&system_class, "out");
// Retrieve an enum constant using the field
let access_mode_enum = jvm.static_class("java.nio.file.AccessMode")?;
let access_mode_write = jvm.field(&access_mode_enum, "WRITE")?;

// Retrieve a nested class (note the use of `$` instead of `.`)
let state = jvm.static_class("java.lang.Thread$State")?;
```

`Instances`s of Java `List`s and `Map`s can be created with the `java_list` and `java_map` functions:
Expand Down

0 comments on commit 3911e14

Please sign in to comment.