Skip to content

String overloads as an alternative to ZBytes#173

Merged
milyin merged 2 commits intoeclipse-zenoh:mainfrom
ZettaScaleLabs:string_overloads
Jan 15, 2025
Merged

String overloads as an alternative to ZBytes#173
milyin merged 2 commits intoeclipse-zenoh:mainfrom
ZettaScaleLabs:string_overloads

Conversation

@DariusIMP
Copy link
Member

On the Rust API we allow users to directly pass a payload as a string. This PR introduces that functionality to the Java API by providing function overloads that accept String parameters for payloads.

Example:
Instead of having to do like

session.put(keyExpr, ZBytes.from("Example"));

now users can directly do

session.put(keyExpr, "Example");

This applies to all the functions that expect some ZBytes parameter.

Allowing users to directly pass a String param to functions expecting ZBytes, instead of making them create a ZBytes instance from the String through ZBytes.from(string)
@DariusIMP DariusIMP requested a review from milyin January 8, 2025 16:03
@DariusIMP DariusIMP added enhancement Existing things could work better release Part of the next release labels Jan 8, 2025
@milyin milyin merged commit 7b2bbfa into eclipse-zenoh:main Jan 15, 2025
6 of 9 checks passed
@DariusIMP DariusIMP deleted the string_overloads branch January 16, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Existing things could work better release Part of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants