Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt1005_2024_group12
Manage
Activity
Members
Labels
Plan
Issues
15
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gruppe12
idatt1005_2024_group12
Merge requests
!4
Finish implementing Grocery
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Finish implementing Grocery
implement-test-grocery
into
dev
Overview
0
Commits
5
Pipelines
1
Changes
2
Merged
Jon Bergland
requested to merge
implement-test-grocery
into
dev
1 year ago
Overview
0
Commits
5
Pipelines
1
Changes
2
Expand
0
0
Merge request reports
Compare
dev
dev (base)
and
latest version
latest version
f4c4f101
5 commits,
1 year ago
2 files
+
91
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/main/java/stud/ntnu/idatt1005/model/Grocery.java
+
21
−
2
Options
@@ -3,7 +3,7 @@ package stud.ntnu.idatt1005.model;
import
java.util.Date
;
/**
* This is a entity class representing groceries
* This is a
n
entity class representing groceries
* It contains the name, quantity, category and expiration date of the grocery
*/
public
class
Grocery
{
@@ -26,6 +26,17 @@ public class Grocery {
this
.
expirationDate
=
expirationDate
;
}
/**
* Deep-copy constructor for the Grocery class
* @param grocery the grocery to be copied
*/
public
Grocery
(
Grocery
grocery
)
{
this
.
name
=
grocery
.
name
;
this
.
quantity
=
grocery
.
quantity
;
this
.
category
=
grocery
.
category
;
this
.
expirationDate
=
grocery
.
expirationDate
;
}
/**
* Get the name of the grocery
* @return the name of the grocery
@@ -50,9 +61,17 @@ public class Grocery {
return
category
;
}
/**
* Get the expiration date of the grocery
* @return the expiration date of the grocery
*/
public
Date
getExpirationDate
()
{
return
expirationDate
;
}
@Override
public
String
toString
()
{
return
"Name: "
+
name
+
", Quantity: "
+
quantity
+
", Category: "
+
category
+
", Expiration date: "
+
expirationDate
;
}
}
Loading