FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java8InAction/src/main/java/lambdasinaction/chap11/Quote.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
/
chap11
/
Quote.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (27 loc) · 870 Bytes
Breadcrumbs
Java8InAction
/
src
/
main
/
java
/
lambdasinaction
/
chap11
/
Quote.java
Copy path
File metadata and controls
34 lines (27 loc) · 870 Bytes
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
package
lambdasinaction
.
chap11
;
public
class
Quote
{
private
final
String
shopName
;
private
final
double
price
;
private
final
Discount
.
Code
discountCode
;
public
Quote
(
String
shopName
,
double
price
,
Discount
.
Code
discountCode
) {
this
.
shopName
=
shopName
;
this
.
price
=
price
;
this
.
discountCode
=
discountCode
;
}
public
static
Quote
parse
(
String
s
) {
String
[]
split
=
s
.
split
(
":"
);
String
shopName
=
split
[
0
];
double
price
=
Double
.
parseDouble
(
split
[
1
]);
Discount
.
Code
discountCode
=
Discount
.
Code
.
valueOf
(
split
[
2
]);
return
new
Quote
(
shopName
,
price
,
discountCode
);
}
public
String
getShopName
() {
return
shopName
;
}
public
double
getPrice
() {
return
price
;
}
public
Discount
.
Code
getDiscountCode
() {
return
discountCode
;
}
}
Back
|
FazBrowse Home
|
New Git URL