-
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working in DHT with new SettingsPack API.
- Loading branch information
Showing
4 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.frostwire.jlibtorrent; | ||
|
||
import com.frostwire.jlibtorrent.swig.settings_pack; | ||
|
||
/** | ||
* The ``settings_pack`` struct, contains the names of all settings as | ||
* enum values. These values are passed in to the ``set_str()``, | ||
* ``set_int()``, ``set_bool()`` functions, to specify the setting to | ||
* change. | ||
* | ||
* @author gubatron | ||
* @author aldenml | ||
*/ | ||
public final class SettingsPack { | ||
|
||
private final settings_pack sp; | ||
|
||
public SettingsPack(settings_pack sp) { | ||
this.sp = sp; | ||
} | ||
|
||
public SettingsPack() { | ||
this(new settings_pack()); | ||
} | ||
|
||
public settings_pack getSwig() { | ||
return sp; | ||
} | ||
|
||
public boolean getBoolean(int name) { | ||
return sp.get_bool(name); | ||
} | ||
|
||
public void setBoolean(int name, boolean value) { | ||
sp.set_bool(name, value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DRY with private method