[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dbus
Subject:    Default value for `in` parameter
From:       Charles Wong <ymqiuyu () gmail ! com>
Date:       2023-01-28 12:01:14
Message-ID: CAAcWGFKiu9CxRsHX4si44-wXhSmL_H8=q37D7J_fBh=n9qRrkg () mail ! gmail ! com
[Download RAW message or body]

Hi,

Is this the  right place to ask dbus questions?

For example, there is a dbus config (is from
https://gjs.guide/guides/gio/dbus.html#high-level-proxies):
```xml
<method name="ComplexMethod">
    <arg type="b" direction="in" name="input"/>
    <arg type="u" direction="out" name="length"/>
</method>
```

Is it possible to set a default value to parameter `input` and mark it as
unrequired?

Just like in spring mvc, we can set a parameter `required=false` and set
`default` value too:
`@RequestParam(required = false, defaultValue = "default value") String
parameter`

[Attachment #3 (text/html)]

<div dir="ltr">Hi,  <div><br></div><div>Is this the   right place to ask dbus \
questions?</div><div><br></div><div>For example, there is a dbus config (is from <a \
href="https://gjs.guide/guides/gio/dbus.html#high-level-proxies">https://gjs.guide/gui \
des/gio/dbus.html#high-level-proxies</a>):</div><div>```xml<br></div><div>&lt;method \
name=&quot;ComplexMethod&quot;&gt;<br>      &lt;arg type=&quot;b&quot; \
direction=&quot;in&quot; name=&quot;input&quot;/&gt;<br>      &lt;arg \
type=&quot;u&quot; direction=&quot;out&quot; \
name=&quot;length&quot;/&gt;<br>&lt;/method&gt;<br></div><div>```<br></div><div><br></div><div>Is \
it possible to set a default value to parameter `input` and  mark it as \
unrequired?</div><div><br></div><div>Just like in spring mvc, we can set a parameter \
`required=false` and set `default` value too:<br></div><div>`@RequestParam(required = \
false, defaultValue = &quot;default value&quot;) String parameter`<br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic