mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
[xdata] Add BooleanFormField.getValueAsBooleanOrNull()
This method is meant to provide 'raw' access to what has been sent over the wire. It is assumed to be not of much use in the typically case, but provided for completeness.
This commit is contained in:
parent
940d7bf02a
commit
5c46451cd2
1 changed files with 14 additions and 0 deletions
|
@ -49,6 +49,20 @@ public class BooleanFormField extends SingleValueFormField {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of the boolean field or maybe <code>null</code>. Note that you usually want to use
|
||||||
|
* {@link #getValueAsBoolean()} instead of this method, as {@link #getValueAsBoolean()} considers the default value
|
||||||
|
* of boolean fields. That is, boolean form fields have the value <code>false</code> if not explicitly set to
|
||||||
|
* something else.
|
||||||
|
*
|
||||||
|
* @return the boolean value of this form field or <code>null</code> if no value was explicitly provided.
|
||||||
|
* @see #getValueAsBoolean()
|
||||||
|
* @since 4.4.5
|
||||||
|
*/
|
||||||
|
public Boolean getValueAsBooleanOrNull() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
public Builder asBuilder() {
|
public Builder asBuilder() {
|
||||||
return new Builder(this);
|
return new Builder(this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue