Package org.zkoss.stateless.sul

## Interface IRating

- All Superinterfaces:
    `IComponent<IRating>`, `IDisable<IRating>`, `IHtmlBasedComponent<IRating>`, `IReadonly<IRating>`

      public interface IRating
      extends IHtmlBasedComponent<IRating>, IDisable<IRating>, IReadonly<IRating>

  Immutable `Rating` component

  A rating component provides a icon based rating input. The default icon is Unicode `"★"` star icon. Icons could be set to unicode icons by specifying Unicode. (for example: `"☎"`) Or even Font Awesome icons with the prefix z-icon. (for example: `"z-icon-home"`)

  ### Support @Action

  Name | Action Type
  --- | ---
  onChange
  Denotes user has rated, the value can be received from `RequestData.getData()` with the key `"rating"`

  Author:
    katherine
  See Also:
    `Rating`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IRating.Builder` | Builds instances of type `IRating`.
    `static class` | `IRating.Orient` | Specifies the orient with `withOrient(Orient)`
    `static class` | `IRating.Updater` | Builds an updater of type `IRating` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IRating` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.lang.String` | `getIconSclass()` | Returns the iconSclass name of this rating.
    `default int` | `getMax()` | Returns the max rating of this rating component.
    `default java.lang.String` | `getOrient()` | Returns the orient.
    `default int` | `getRating()` | Returns the rating.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isCancelable()` | Returns whether this rating component is cancelable.
    `default boolean` | `isReadonly()` | Returns if this rating component is readonly.
    `static IRating` | `of​(int rating)` | Returns the instance with the given rating.
    `static IRating` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static IRating` | `ofMax​(int max)` | Returns the instance with the given max
    `IRating` | `withCancelable​(boolean cancelable)` | Returns a copy of `this` immutable component with the specified `cancelable`.
    `IRating` | `withIconSclass​(java.lang.String iconSclass)` | Returns a copy of `this` immutable component with the specified `iconSclass`.
    `IRating` | `withMax​(int max)` | Returns a copy of `this` immutable component with the specified `max`.
    `IRating` | `withOrient​(java.lang.String orient)` | Returns a copy of `this` immutable component with the specified `orient`.
    `default IRating` | `withOrient​(IRating.Orient orient)` | Returns a copy of `this` immutable component with the specified `orient`.
    `IRating` | `withRating​(int rating)` | Returns a copy of `this` immutable component with the specified `rating`.
    `IRating` | `withReadonly​(boolean readonly)` | Returns a copy of `this` immutable component with the specified `readonly`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IDisable

      `isDisabled, withDisabled`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

- - ### Field Detail

    - #### DEFAULT

          static final IRating DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.wgt.Rating"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IRating>`

    - #### getMax

          default int getMax()

      Returns the max rating of this rating component. Default: `5`

    - #### withMax

          IRating withMax​(int max)

      Returns a copy of `this` immutable component with the specified `max`.

      Sets the max rating of this rating component

      Parameters:
        `max` - The max rating of this rating component

        Default: `5`.

      Returns:
        A modified copy of the `this` object

    - #### getRating

          default int getRating()

      Returns the rating.

      Default: `0`

    - #### withRating

          IRating withRating​(int rating)

      Returns a copy of `this` immutable component with the specified `rating`.

      Sets the rating.

      Parameters:
        `rating` - Sets the rating.

        Default: `0`.

      Returns:
        A modified copy of the `this` object

    - #### isReadonly

          default boolean isReadonly()

      Returns if this rating component is readonly.

      Default: `false`

      Specified by:
        `isReadonly` in interface `IReadonly<IRating>`

    - #### withReadonly

          IRating withReadonly​(boolean readonly)

      Returns a copy of `this` immutable component with the specified `readonly`.

      Sets if this rating component is readonly.

      Specified by:
        `withReadonly` in interface `IReadonly<IRating>`
      Parameters:
        `readonly` - Whether this rating component is readonly.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isCancelable

          default boolean isCancelable()

      Returns whether this rating component is cancelable. If true, the rating could be cancelled by clicking the rated-rating again.

      Default: `true`

    - #### withCancelable

          IRating withCancelable​(boolean cancelable)

      Returns a copy of `this` immutable component with the specified `cancelable`.

      Sets whether this rating component is cancelable.

      Parameters:
        `cancelable` - Whether this rating component is cancelable.

        Default: `true`.

      Returns:
        A modified copy of the `this` object

    - #### getOrient

          default java.lang.String getOrient()

      Returns the orient.

      Default: `"horizontal"`.

    - #### withOrient

          IRating withOrient​(java.lang.String orient)

      Returns a copy of `this` immutable component with the specified `orient`.

      Sets the orient.

      Parameters:
        `orient` - Either `"horizontal"` or `"vertical"`

        Default: `"horizontal"`.

      Returns:
        A modified copy of the `this` object

    - #### withOrient

          default IRating withOrient​(IRating.Orient orient)

      Returns a copy of `this` immutable component with the specified `orient`.

      Sets the orient.

      Parameters:
        `orient` - Either `"horizontal"` or `"vertical"`

        Default: `"horizontal"`.

      Returns:
        A modified copy of the `this` object

    - #### getIconSclass

          default java.lang.String getIconSclass()

      Returns the iconSclass name of this rating.

      Default: `"z-icon-star"`

    - #### withIconSclass

          IRating withIconSclass​(java.lang.String iconSclass)

      Returns a copy of `this` immutable component with the specified `iconSclass`.

      Sets the iconSclass name of this rating.

      Parameters:
        `iconSclass` - The iconSclass name of this rating.

        Default: `"z-icon-star"`.

      Returns:
        A modified copy of the `this` object

    - #### of

          static IRating of​(int rating)

      Returns the instance with the given rating.
      Parameters:
        `rating` - The rating of the component.

    - #### ofMax

          static IRating ofMax​(int max)

      Returns the instance with the given max
      Parameters:
        `max` - The maximum value of the rating.

    - #### ofId

          static IRating ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component