Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit dcfdb057
authored
Mar 26, 2023
by
Liv Haapala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding sort to product\'s options list
1 parent
38b4bea9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
code/moya-database/src/main/java/fi/codecrew/moya/model/ProductOptionGroup.java
code/moya-database/src/main/java/fi/codecrew/moya/model/ProductOptionGroup.java
View file @
dcfdb05
...
@@ -24,6 +24,7 @@ package fi.codecrew.moya.model;
...
@@ -24,6 +24,7 @@ package fi.codecrew.moya.model;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -87,6 +88,11 @@ public class ProductOptionGroup extends GenericEntity implements Cloneable {
...
@@ -87,6 +88,11 @@ public class ProductOptionGroup extends GenericEntity implements Cloneable {
}
}
public
List
<
ProductOption
>
getOptions
()
{
public
List
<
ProductOption
>
getOptions
()
{
Collections
.
sort
(
options
,
(
po1
,
po2
)
->{
return
po1
.
getPriority
()
-
po2
.
getPriority
();
}
);
return
options
;
return
options
;
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment