Class SubscriptionBase
java.lang.Object
org.strassburger.subscriptionmanager.view.subscriptions.SubscriptionBase
- Direct Known Subclasses:
AddSubscriptionView,EditSubscriptionView
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAsks User to choose between categories or to add a new categoryReads the billing period from the UIreadName(org.strassburger.tui4j.input.validationrules.ValidationRule<String> nameAlreadyExistsValidationRule) Reads the name of the subscription from the UIdoubleReads the price from the UIReads the start date from the UIvoidsetExistingCategories(Set<String> categories)
-
Constructor Details
-
SubscriptionBase
public SubscriptionBase()
-
-
Method Details
-
setExistingCategories
-
readName
public String readName(org.strassburger.tui4j.input.validationrules.ValidationRule<String> nameAlreadyExistsValidationRule) Reads the name of the subscription from the UI- Parameters:
nameAlreadyExistsValidationRule- Validation rule to check if the name already exists.- Returns:
- The name of the subscription.
-
readBillingPeriod
Reads the billing period from the UI- Returns:
- The billing period.
-
readPrice
public double readPrice()Reads the price from the UI- Returns:
- The price.
-
readStartDate
Reads the start date from the UI- Returns:
- The start date in milliseconds since epoch.
-
chooseOrAddCategory
Asks User to choose between categories or to add a new category- Returns:
- chosen category or runs methode askForNewCategory to add new category
-