Package com.onec.ui

Record Class PageComponent

java.lang.Object
java.lang.Record
com.onec.ui.PageComponent

public record PageComponent(PageComponent.Kind kind, String text, String customType, Map<String,Object> payload, Class<?> entity) extends Record
A freeform block a Page composes beyond the widget grid: a text block, a div-custom extension, a full interactive entity list, or a section of action buttons. Renderer-agnostic; the DivKit emitter compiles it (text → div-text, custom → div-custom, list → the onec-list surface built from the entity's metadata, actions → the onec-actions button section).
  • Constructor Details

    • PageComponent

      public PageComponent(PageComponent.Kind kind, String text, String customType, Map<String,Object> payload, Class<?> entity)
      Creates an instance of a PageComponent record class.
      Parameters:
      kind - the value for the kind record component
      text - the value for the text record component
      customType - the value for the customType record component
      payload - the value for the payload record component
      entity - the value for the entity record component
  • Method Details

    • text

      public static PageComponent text(String text)
    • custom

      public static PageComponent custom(String customType, Map<String,Object> payload)
    • list

      public static PageComponent list(Class<?> entity)
      The full interactive list surface for a catalog/document, embedded in the page.
    • actions

      public static PageComponent actions(String heading, List<Map<String,Object>> buttons)
      A section of action buttons under an optional heading. buttons are the rendered descriptors (key/label/icon/server/url); the server handlers live on the PageBuilder and are resolved by key when the button posts back. The renderer fills in the page route the buttons post to.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • kind

      public PageComponent.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • customType

      public String customType()
      Returns the value of the customType record component.
      Returns:
      the value of the customType record component
    • payload

      public Map<String,Object> payload()
      Returns the value of the payload record component.
      Returns:
      the value of the payload record component
    • entity

      public Class<?> entity()
      Returns the value of the entity record component.
      Returns:
      the value of the entity record component