Skip to content

Commit

Permalink
allow chaining of .set() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNavaStar committed Sep 4, 2024
1 parent b7161d7 commit 7992d6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/me/mrnavastar/r/R.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ public <T> T get(String name, Class<T> type) {
/**
* Set the value of a field. Can be private, final, or static
*/
public void set(String name, Object value) {
public R set(String name, Object value) {
try {
findField(name, clazz).set(instance, value);
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new RuntimeException(e);
}
return this;
}

/**
Expand Down

0 comments on commit 7992d6b

Please sign in to comment.