Package com.day.cq.wcm.commons.status
Class EditorResourceStatus.Builder
- java.lang.Object
-
- com.day.cq.wcm.commons.status.EditorResourceStatus.Builder
-
- Enclosing class:
- EditorResourceStatus
public static class EditorResourceStatus.Builder extends java.lang.Object
Builder class to buildEditorResourceStatus
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String type, java.lang.String title, java.lang.String message)
Creates a newBuilder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EditorResourceStatus.Builder
addAction(java.lang.String id, java.lang.String label)
Associates an action with this status.EditorResourceStatus.Builder
addData(java.lang.String key, java.lang.Object value)
Associates additional data with this status.EditorResourceStatus
build()
Builds and returns theEditorResourceStatus
instance.EditorResourceStatus.Builder
setIcon(java.lang.String icon)
Sets the status icon.EditorResourceStatus.Builder
setPriority(java.lang.Integer priority)
Sets the status priority.EditorResourceStatus.Builder
setVariant(EditorResourceStatus.Variant variant)
Sets the status variant.
-
-
-
Constructor Detail
-
Builder
public Builder(@Nonnull java.lang.String type, @Nonnull java.lang.String title, @Nonnull java.lang.String message)
Creates a newBuilder
.- Parameters:
type
- the status type (seeEditorResourceStatus.getType()
)title
- the status title (seeEditorResourceStatus.getTitle()
)message
- the status message (seeEditorResourceStatus.getMessage()
)
-
-
Method Detail
-
setPriority
@Nonnull public EditorResourceStatus.Builder setPriority(@Nullable java.lang.Integer priority)
Sets the status priority.- Parameters:
priority
- the status priority ornull
to unset it- Returns:
- the current
Builder
- See Also:
EditorResourceStatus.getPriority()
-
setVariant
@Nonnull public EditorResourceStatus.Builder setVariant(@Nullable EditorResourceStatus.Variant variant)
Sets the status variant.- Parameters:
variant
- the status variant ornull
to unset it- Returns:
- the current
Builder
- See Also:
EditorResourceStatus.getVariant()
,EditorResourceStatus.Variant
-
setIcon
@Nonnull public EditorResourceStatus.Builder setIcon(@Nullable java.lang.String icon)
Sets the status icon.- Parameters:
icon
- the status icon ornull
to unset it- Returns:
- the current
Builder
- See Also:
EditorResourceStatus.getIcon()
-
addData
public EditorResourceStatus.Builder addData(java.lang.String key, java.lang.Object value)
Associates additional data with this status. This data is available as properties when retrieving status resources (seeResourceStatus
).- Parameters:
key
- the keyvalue
- the value- Returns:
- this
-
addAction
public EditorResourceStatus.Builder addAction(java.lang.String id, java.lang.String label)
Associates an action with this status.
- Parameters:
id
- the action id (seeEditorResourceStatus.Action.getId()
)label
- the action label (seeEditorResourceStatus.Action.getLabel()
)- Returns:
- this
-
build
public EditorResourceStatus build()
Builds and returns theEditorResourceStatus
instance.- Returns:
- the
EditorResourceStatus
instance
-
-