FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java8InAction/src/main/java/lambdasinaction/chap4/Dish.java at master · java8/Java8InAction · GitHub
java8
/
Java8InAction
Public
Notifications
You must be signed in to change notification settings
Fork
2.2k
Star
3.2k
Code
Issues
18
Pull requests
7
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Java8InAction
/
src
/
main
/
java
/
lambdasinaction
/
chap4
/
Dish.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (41 loc) · 1.46 KB
Breadcrumbs
Java8InAction
/
src
/
main
/
java
/
lambdasinaction
/
chap4
/
Dish.java
Copy path
File metadata and controls
51 lines (41 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package
lambdasinaction
.
chap4
;
import
java
.
util
.*;
public
class
Dish
{
private
final
String
name
;
private
final
boolean
vegetarian
;
private
final
int
calories
;
private
final
Type
type
;
public
Dish
(
String
name
,
boolean
vegetarian
,
int
calories
,
Type
type
) {
this
.
name
=
name
;
this
.
vegetarian
=
vegetarian
;
this
.
calories
=
calories
;
this
.
type
=
type
;
}
public
String
getName
() {
return
name
;
}
public
boolean
isVegetarian
() {
return
vegetarian
;
}
public
int
getCalories
() {
return
calories
;
}
public
Type
getType
() {
return
type
;
}
public
enum
Type
{
MEAT
,
FISH
,
OTHER
}
@
Override
public
String
toString
() {
return
name
;
}
public
static
final
List
<
Dish
>
menu
=
Arrays
.
asList
(
new
Dish
(
"pork"
,
false
,
800
,
Dish
.
Type
.
MEAT
),
new
Dish
(
"beef"
,
false
,
700
,
Dish
.
Type
.
MEAT
),
new
Dish
(
"chicken"
,
false
,
400
,
Dish
.
Type
.
MEAT
),
new
Dish
(
"french fries"
,
true
,
530
,
Dish
.
Type
.
OTHER
),
new
Dish
(
"rice"
,
true
,
350
,
Dish
.
Type
.
OTHER
),
new
Dish
(
"season fruit"
,
true
,
120
,
Dish
.
Type
.
OTHER
),
new
Dish
(
"pizza"
,
true
,
550
,
Dish
.
Type
.
OTHER
),
new
Dish
(
"prawns"
,
false
,
400
,
Dish
.
Type
.
FISH
),
new
Dish
(
"salmon"
,
false
,
450
,
Dish
.
Type
.
FISH
));
}
Back
|
FazBrowse Home
|
New Git URL