java.lang.Object
no.ntnu.principes.domain.onboarding.OnboardingDetails
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 Summary
ConstructorsConstructorDescriptionCreates an empty OnboardingDetails with default values.OnboardingDetails(HouseholdType householdType, String householdName, List<String> members) Creates an OnboardingDetails with specified initial values. -
Method Summary
Modifier and TypeMethodDescriptionclean()Removes all blank member entries and returns the cleaned instance.Gets the household name.Gets the household type.members()Gets the list of household members.voidAdds a new empty member slot to the household.voidremoveMember(int index) Removes a member from the household at the specified index.voidsetHouseholdName(String householdName) Updates the household name.voidsetHouseholdType(HouseholdType householdType) Updates the household type.voidUpdates a member's name at the specified index.
-
Constructor Details
-
OnboardingDetails
Creates an OnboardingDetails with specified initial values.- Parameters:
householdType- The type of household being createdhouseholdName- The name of the householdmembers- 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
Gets the household type.- Returns:
- The selected household type
-
householdName
Gets the household name.- Returns:
- The household name
-
members
Gets the list of household members.- Returns:
- List of member names
-
setHouseholdType
Updates the household type.- Parameters:
householdType- The new household type
-
setHouseholdName
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
Updates a member's name at the specified index.- Parameters:
index- The position of the member to updatename- The new name for the member
-
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
-