-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility for Tuples as return types to dbus method calls
In dbus it is possible for a method to have multiple return types. To map this into the java world, the dbus-java library wraps the return types into a class, that contains all desired values as fields. This class extends the Tuple class and is normally generated by the InterfaceCodeGenerator. There was a piece missing in the library, that could deal with such Tuples as a return type to a dbus method call. This commit adds the missing piece and a little test case.
- Loading branch information
Showing
3 changed files
with
72 additions
and
11 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
33 changes: 33 additions & 0 deletions
33
dbus-java/src/test/java/org/freedesktop/dbus/test/helper/structs/MarkTuple.java
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,33 @@ | ||
package org.freedesktop.dbus.test.helper.structs; | ||
|
||
import org.freedesktop.dbus.Tuple; | ||
import org.freedesktop.dbus.annotations.Position; | ||
|
||
public class MarkTuple extends Tuple { | ||
@Position(0) | ||
private String slotName; | ||
@Position(1) | ||
private String message; | ||
|
||
public MarkTuple(String slotName, String message) { | ||
this.slotName = slotName; | ||
this.message = message; | ||
} | ||
|
||
public void setSlotName(String arg) { | ||
slotName = arg; | ||
} | ||
|
||
public String getSlotName() { | ||
return slotName; | ||
} | ||
public void setMessage(String arg) { | ||
message = arg; | ||
} | ||
|
||
public String getMessage() { | ||
return message; | ||
} | ||
|
||
|
||
} |