Record Class UserSpace

java.lang.Object
java.lang.Record
io.meeds.social.space.rest.model.UserSpace
Record Components:
id - space technical identifier
displayName - space name as displayed
prettyName - space name as used in URLs
url - space home URL
avatarUrl - space avatar URL, null when the space has none
visibility - space visibility
membersCount - number of members of the space
member - whether the viewer is a member of the space

public record UserSpace(long id, String displayName, String prettyName, String url, String avatarUrl, String visibility, int membersCount, boolean member) extends Record
A space of a profile owner, as it is displayed to a viewer.

Everything the listing renders is carried here on purpose. A viewer may see a space they are not a member of — a PRIVATE space is listed, only HIDDEN ones are filtered out — and resolving such a space through the per-space endpoints would be refused, leaving the UI to render a placeholder for a space it was told to display. member lets the UI present the two cases differently instead.

  • Constructor Details

    • UserSpace

      public UserSpace(long id, String displayName, String prettyName, String url, String avatarUrl, String visibility, int membersCount, boolean member)
      Creates an instance of a UserSpace record class.
      Parameters:
      id - the value for the id record component
      displayName - the value for the displayName record component
      prettyName - the value for the prettyName record component
      url - the value for the url record component
      avatarUrl - the value for the avatarUrl record component
      visibility - the value for the visibility record component
      membersCount - the value for the membersCount record component
      member - the value for the member record component
  • Method Details

    • 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.
    • id

      public long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • displayName

      public String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • prettyName

      public String prettyName()
      Returns the value of the prettyName record component.
      Returns:
      the value of the prettyName record component
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • avatarUrl

      public String avatarUrl()
      Returns the value of the avatarUrl record component.
      Returns:
      the value of the avatarUrl record component
    • visibility

      public String visibility()
      Returns the value of the visibility record component.
      Returns:
      the value of the visibility record component
    • membersCount

      public int membersCount()
      Returns the value of the membersCount record component.
      Returns:
      the value of the membersCount record component
    • member

      public boolean member()
      Returns the value of the member record component.
      Returns:
      the value of the member record component