Record Class SubspacesEnvelope

java.lang.Object
java.lang.Record
io.meeds.social.portlet.model.SubspacesEnvelope

public record SubspacesEnvelope(boolean parentSpace, boolean canManageSpace, boolean canCreateSubspace, List<SubspaceItem> subspaces, StoredSettings settings) extends Record
What the widget renders from. parentSpace false means the widget hides its whole application: the other fields are then empty and no listing query ran.

settings is what the preferences hold, not what a client asked to store: it is how the drawer learns whether its save was applied. The action phase answers 200 whatever happens — a PortletException thrown by SubspacesListPortlet.processAction is rethrown by the portal's UIPortletActionListener and swallowed by PortalRequestHandler, which logs it and commits the response untouched — so the transport cannot tell a stored value from a refused one, and only reading the preferences back can.

  • Constructor Details

    • SubspacesEnvelope

      public SubspacesEnvelope(boolean parentSpace, boolean canManageSpace, boolean canCreateSubspace, List<SubspaceItem> subspaces, StoredSettings settings)
      Creates an instance of a SubspacesEnvelope record class.
      Parameters:
      parentSpace - the value for the parentSpace record component
      canManageSpace - the value for the canManageSpace record component
      canCreateSubspace - the value for the canCreateSubspace record component
      subspaces - the value for the subspaces record component
      settings - the value for the settings record component
  • Method Details

    • notParentSpace

      public static SubspacesEnvelope notParentSpace()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • parentSpace

      public boolean parentSpace()
      Returns the value of the parentSpace record component.
      Returns:
      the value of the parentSpace record component
    • canManageSpace

      public boolean canManageSpace()
      Returns the value of the canManageSpace record component.
      Returns:
      the value of the canManageSpace record component
    • canCreateSubspace

      public boolean canCreateSubspace()
      Returns the value of the canCreateSubspace record component.
      Returns:
      the value of the canCreateSubspace record component
    • subspaces

      public List<SubspaceItem> subspaces()
      Returns the value of the subspaces record component.
      Returns:
      the value of the subspaces record component
    • settings

      public StoredSettings settings()
      Returns the value of the settings record component.
      Returns:
      the value of the settings record component