Class OnboardingDetails

java.lang.Object
no.ntnu.principes.domain.onboarding.OnboardingDetails

public class OnboardingDetails extends Object
Stores and manages household information collected during the onboarding process. Maintains household type, name, and a list of household members that can be modified throughout the onboarding flow.
  • Constructor Details

    • OnboardingDetails

      public OnboardingDetails(HouseholdType householdType, String householdName, List<String> members)
      Creates an OnboardingDetails with specified initial values.
      Parameters:
      householdType - The type of household being created
      householdName - The name of the household
      members - List of household member names
    • OnboardingDetails

      public OnboardingDetails()
      Creates an empty OnboardingDetails with default values. Initializes with null household type and name, and three empty member slots.
  • Method Details

    • householdType

      public HouseholdType householdType()
      Gets the household type.
      Returns:
      The selected household type
    • householdName

      public String householdName()
      Gets the household name.
      Returns:
      The household name
    • members

      public List<String> members()
      Gets the list of household members.
      Returns:
      List of member names
    • setHouseholdType

      public void setHouseholdType(HouseholdType householdType)
      Updates the household type.
      Parameters:
      householdType - The new household type
    • setHouseholdName

      public void setHouseholdName(String householdName)
      Updates the household name.
      Parameters:
      householdName - The new household name
    • newMember

      public void newMember()
      Adds a new empty member slot to the household.
    • removeMember

      public void removeMember(int index)
      Removes a member from the household at the specified index.
      Parameters:
      index - The position of the member to remove
    • setMember

      public void setMember(int index, String name)
      Updates a member's name at the specified index.
      Parameters:
      index - The position of the member to update
      name - The new name for the member
    • clean

      public OnboardingDetails clean()
      Removes all blank member entries and returns the cleaned instance. Used to prepare the data for final submission.
      Returns:
      The current instance with blank members removed