From eb63f4c6d21cb070985fcd969a1bb218c63873ba Mon Sep 17 00:00:00 2001 From: Sergey Vinogradov Date: Thu, 11 Jul 2024 14:45:06 +0300 Subject: [PATCH] docs: improve consistency of JavaDoc for i18n methods (#6431) --- .../com/vaadin/flow/component/applayout/AppLayout.java | 9 ++++----- .../java/com/vaadin/flow/component/avatar/Avatar.java | 10 ++++------ .../com/vaadin/flow/component/avatar/AvatarGroup.java | 9 ++++----- .../flow/component/combobox/MultiSelectComboBox.java | 7 +++---- .../vaadin/flow/component/datepicker/DatePicker.java | 9 ++++----- .../flow/component/datetimepicker/DateTimePicker.java | 5 ++--- .../com/vaadin/flow/component/menubar/MenuBar.java | 10 ++++------ .../vaadin/flow/component/messages/MessageInput.java | 9 ++++----- .../flow/component/richtexteditor/RichTextEditor.java | 9 ++++----- .../com/vaadin/flow/component/sidenav/SideNav.java | 8 +++----- .../java/com/vaadin/flow/component/upload/Upload.java | 8 +++----- 11 files changed, 39 insertions(+), 54 deletions(-) diff --git a/vaadin-app-layout-flow-parent/vaadin-app-layout-flow/src/main/java/com/vaadin/flow/component/applayout/AppLayout.java b/vaadin-app-layout-flow-parent/vaadin-app-layout-flow/src/main/java/com/vaadin/flow/component/applayout/AppLayout.java index ad76d98841e..cf1fb21ce4e 100644 --- a/vaadin-app-layout-flow-parent/vaadin-app-layout-flow/src/main/java/com/vaadin/flow/component/applayout/AppLayout.java +++ b/vaadin-app-layout-flow-parent/vaadin-app-layout-flow/src/main/java/com/vaadin/flow/component/applayout/AppLayout.java @@ -72,20 +72,19 @@ public class AppLayout extends Component implements RouterLayout, HasStyle { *

* NOTE: Updating the instance that is returned from this method will not * update the component if not set again using - * {@link AppLayout#setI18n(AppLayoutI18n)} + * {@link #setI18n(AppLayoutI18n)} * - * @return the i18n object. It will be null, if the i18n - * properties are not set. + * @return the i18n object or {@code null} if no i18n object has been set */ public AppLayoutI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. + * Sets the internationalization object for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(AppLayoutI18n i18n) { this.i18n = Objects.requireNonNull(i18n, diff --git a/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/Avatar.java b/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/Avatar.java index 880ae79de5e..9d39dfe0edf 100644 --- a/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/Avatar.java +++ b/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/Avatar.java @@ -134,21 +134,19 @@ public Avatar(String name, String url) { * Gets the internationalization object previously set for this component. *

* NOTE: Updating the instance that is returned from this method will not - * update the component if not set again using - * {@link Avatar#setI18n(AvatarI18n)} + * update the component if not set again using {@link #setI18n(AvatarI18n)} * - * @return the i18n object. It will be null, If the i18n - * properties weren't set. + * @return the i18n object or {@code null} if no i18n object has been set */ public AvatarI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. + * Sets the internationalization object for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(AvatarI18n i18n) { this.i18n = Objects.requireNonNull(i18n, diff --git a/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/AvatarGroup.java b/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/AvatarGroup.java index ca88a302323..aa325328e6c 100644 --- a/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/AvatarGroup.java +++ b/vaadin-avatar-flow-parent/vaadin-avatar-flow/src/main/java/com/vaadin/flow/component/avatar/AvatarGroup.java @@ -646,20 +646,19 @@ public List getItems() { *

* NOTE: Updating the instance that is returned from this method will not * update the component if not set again using - * {@link AvatarGroup#setI18n(AvatarGroupI18n)} + * {@link #setI18n(AvatarGroupI18n)} * - * @return the i18n object. It will be null, If the i18n - * properties weren't set. + * @return the i18n object or {@code null} if no i18n object has been set */ public AvatarGroupI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. + * Sets the internationalization object for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(AvatarGroupI18n i18n) { this.i18n = Objects.requireNonNull(i18n, diff --git a/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/MultiSelectComboBox.java b/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/MultiSelectComboBox.java index 5e1265ee741..c6dd8ac46f7 100644 --- a/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/MultiSelectComboBox.java +++ b/vaadin-combo-box-flow-parent/vaadin-combo-box-flow/src/main/java/com/vaadin/flow/component/combobox/MultiSelectComboBox.java @@ -537,18 +537,17 @@ public void setKeepFilter(boolean keepFilter) { * update the component if not set again using * {@link #setI18n(MultiSelectComboBoxI18n)} * - * @return the i18n object. It will be null, if it has not been - * set previously + * @return the i18n object or {@code null} if no i18n object has been set */ public MultiSelectComboBoxI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. + * Sets the internationalization object for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(MultiSelectComboBoxI18n i18n) { this.i18n = Objects.requireNonNull(i18n, diff --git a/vaadin-date-picker-flow-parent/vaadin-date-picker-flow/src/main/java/com/vaadin/flow/component/datepicker/DatePicker.java b/vaadin-date-picker-flow-parent/vaadin-date-picker-flow/src/main/java/com/vaadin/flow/component/datepicker/DatePicker.java index 5796fef4dbc..3df0b583438 100644 --- a/vaadin-date-picker-flow-parent/vaadin-date-picker-flow/src/main/java/com/vaadin/flow/component/datepicker/DatePicker.java +++ b/vaadin-date-picker-flow-parent/vaadin-date-picker-flow/src/main/java/com/vaadin/flow/component/datepicker/DatePicker.java @@ -419,20 +419,19 @@ private void initConnector() { *

* NOTE: Updating the instance that is returned from this method will not * update the component if not set again using - * {@link DatePicker#setI18n(DatePickerI18n)} + * {@link #setI18n(DatePickerI18n)} * - * @return the i18n object. It will be null, If the i18n - * properties weren't set. + * @return the i18n object or {@code null} if no i18n object has been set */ public DatePickerI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. + * Sets the internationalization object for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(DatePickerI18n i18n) { this.i18n = Objects.requireNonNull(i18n, diff --git a/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow/src/main/java/com/vaadin/flow/component/datetimepicker/DateTimePicker.java b/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow/src/main/java/com/vaadin/flow/component/datetimepicker/DateTimePicker.java index 695c3eccf03..a3b129c92da 100644 --- a/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow/src/main/java/com/vaadin/flow/component/datetimepicker/DateTimePicker.java +++ b/vaadin-date-time-picker-flow-parent/vaadin-date-time-picker-flow/src/main/java/com/vaadin/flow/component/datetimepicker/DateTimePicker.java @@ -842,8 +842,7 @@ public LocalDateTime getMax() { * update the component if not set again using * {@link DateTimePicker#setDatePickerI18n(DatePickerI18n)} * - * @return the i18n object. It will be null, If the i18n - * properties weren't set. + * @return the i18n object or {@code null} if no i18n object has been set */ public DatePickerI18n getDatePickerI18n() { return datePickerI18n; @@ -854,7 +853,7 @@ public DatePickerI18n getDatePickerI18n() { * component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setDatePickerI18n(DatePickerI18n i18n) { this.datePickerI18n = Objects.requireNonNull(i18n, diff --git a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBar.java b/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBar.java index b6e24db2d31..a33bb8e428f 100644 --- a/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBar.java +++ b/vaadin-menu-bar-flow-parent/vaadin-menu-bar-flow/src/main/java/com/vaadin/flow/component/menubar/MenuBar.java @@ -392,21 +392,19 @@ public boolean isReverseCollapseOrder() { * Gets the internationalization object previously set for this component. *

* NOTE: Updating the instance that is returned from this method will not - * update the component if not set again using - * {@link MenuBar#setI18n(MenuBarI18n)} + * update the component if not set again using {@link #setI18n(MenuBarI18n)} * - * @return the i18n object. It will be null, If the i18n - * properties weren't set. + * @return the i18n object or {@code null} if no i18n object has been set */ public MenuBarI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. + * Sets the internationalization object for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(MenuBarI18n i18n) { this.i18n = Objects.requireNonNull(i18n, diff --git a/vaadin-messages-flow-parent/vaadin-messages-flow/src/main/java/com/vaadin/flow/component/messages/MessageInput.java b/vaadin-messages-flow-parent/vaadin-messages-flow/src/main/java/com/vaadin/flow/component/messages/MessageInput.java index f5af4d896ce..01f61387510 100644 --- a/vaadin-messages-flow-parent/vaadin-messages-flow/src/main/java/com/vaadin/flow/component/messages/MessageInput.java +++ b/vaadin-messages-flow-parent/vaadin-messages-flow/src/main/java/com/vaadin/flow/component/messages/MessageInput.java @@ -129,18 +129,17 @@ public Registration addSubmitListener( *

* NOTE: Updating the instance that is returned from this method will not * update the component if not set again using - * {@link MessageInput#setI18n(MessageInputI18n)}. + * {@link #setI18n(MessageInputI18n)}. * - * @return the i18n object, or {@code null} if one has not been set with - * {@link #setI18n(MessageInputI18n)} + * @return the i18n object or {@code null} if no i18n object has been set */ public MessageInputI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. It enabled - * you to customize and translate the language used in the message input. + * Sets the internationalization object for this component. It enabled you + * to customize and translate the language used in the message input. *

* Note: updating the object properties after setting the i18n will not * update the component. To make the changes effective, you need to set the diff --git a/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow/src/main/java/com/vaadin/flow/component/richtexteditor/RichTextEditor.java b/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow/src/main/java/com/vaadin/flow/component/richtexteditor/RichTextEditor.java index d2496d01bca..cf0e32a36e6 100644 --- a/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow/src/main/java/com/vaadin/flow/component/richtexteditor/RichTextEditor.java +++ b/vaadin-rich-text-editor-flow-parent/vaadin-rich-text-editor-flow/src/main/java/com/vaadin/flow/component/richtexteditor/RichTextEditor.java @@ -73,20 +73,19 @@ public class RichTextEditor *

* NOTE: Updating the instance that is returned from this method will not * update the component if not set again using - * {@link RichTextEditor#setI18n(RichTextEditorI18n)} + * {@link #setI18n(RichTextEditorI18n)} * - * @return the i18n object. It will be null, If the i18n - * properties weren't set. + * @return the i18n object or {@code null} if no i18n object has been set */ public RichTextEditorI18n getI18n() { return i18n; } /** - * Sets the internationalization properties for this component. + * Sets the internationalization object for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(RichTextEditorI18n i18n) { this.i18n = Objects.requireNonNull(i18n, diff --git a/vaadin-side-nav-flow-parent/vaadin-side-nav-flow/src/main/java/com/vaadin/flow/component/sidenav/SideNav.java b/vaadin-side-nav-flow-parent/vaadin-side-nav-flow/src/main/java/com/vaadin/flow/component/sidenav/SideNav.java index d9709feca7a..38e17040f75 100644 --- a/vaadin-side-nav-flow-parent/vaadin-side-nav-flow/src/main/java/com/vaadin/flow/component/sidenav/SideNav.java +++ b/vaadin-side-nav-flow-parent/vaadin-side-nav-flow/src/main/java/com/vaadin/flow/component/sidenav/SideNav.java @@ -152,11 +152,9 @@ public void setExpanded(boolean expanded) { * Gets the internationalization object previously set for this component. *

* NOTE: Updating the instance that is returned from this method will not - * update the component if not set again using - * {@link SideNav#setI18n(SideNavI18n)} + * update the component if not set again using {@link #setI18n(SideNavI18n)} * - * @return the i18n object. It will be null, If the i18n - * properties weren't set. + * @return the i18n object or {@code null} if no i18n object has been set */ public SideNavI18n getI18n() { return i18n; @@ -168,7 +166,7 @@ public SideNavI18n getI18n() { * web component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(SideNavI18n i18n) { Objects.requireNonNull(i18n, diff --git a/vaadin-upload-flow-parent/vaadin-upload-flow/src/main/java/com/vaadin/flow/component/upload/Upload.java b/vaadin-upload-flow-parent/vaadin-upload-flow/src/main/java/com/vaadin/flow/component/upload/Upload.java index a3afb4fdaa8..64a8d07a832 100644 --- a/vaadin-upload-flow-parent/vaadin-upload-flow/src/main/java/com/vaadin/flow/component/upload/Upload.java +++ b/vaadin-upload-flow-parent/vaadin-upload-flow/src/main/java/com/vaadin/flow/component/upload/Upload.java @@ -645,7 +645,7 @@ public void setReceiver(Receiver receiver) { * Set the internationalization properties for this component. * * @param i18n - * the internationalized properties, not null + * the i18n object, not {@code null} */ public void setI18n(UploadI18N i18n) { this.i18n = Objects.requireNonNull(i18n, @@ -714,11 +714,9 @@ void runBeforeClientResponse(SerializableConsumer command) { * Get the internationalization object previously set for this component. *

* NOTE: Updating the instance that is returned from this method will not - * update the component if not set again using - * {@link Upload#setI18n(UploadI18N)} + * update the component if not set again using {@link #setI18n(UploadI18N)} * - * @return the object with the i18n properties. If the i18n properties - * weren't set, the object will return null. + * @return the i18n object or {@code null} if no i18n object has been set */ public UploadI18N getI18n() { return i18n;