Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
waluty_22sierpnia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
waluty_22sierpnia
Commits
1e6f812f
Commit
1e6f812f
authored
Aug 22, 2021
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Klasa Waluta bez implementacji
parent
d2e05004
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
Waluta.java
src/main/java/waluty/wersja_xml/Waluta.java
+61
-0
No files found.
src/main/java/waluty/wersja_xml/Waluta.java
0 → 100644
View file @
1e6f812f
package
waluty
.
wersja_xml
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Objects
;
// To jest przykład własnej klasy "niemutowalnej" (immutable)
public
class
Waluta
{
private
final
String
kod
;
private
final
String
nazwa
;
private
final
BigDecimal
kurs
;
public
Waluta
(
String
kod
,
String
nazwa
,
BigDecimal
kurs
)
{
this
.
kod
=
kod
;
this
.
nazwa
=
nazwa
;
this
.
kurs
=
kurs
;
}
public
String
getKod
()
{
return
kod
;
}
public
String
getNazwa
()
{
return
nazwa
;
}
public
BigDecimal
getKurs
()
{
return
kurs
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
kod
,
kurs
,
nazwa
);
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
return
true
;
if
(
obj
==
null
)
return
false
;
if
(
getClass
()
!=
obj
.
getClass
())
return
false
;
Waluta
other
=
(
Waluta
)
obj
;
return
Objects
.
equals
(
kod
,
other
.
kod
)
&&
Objects
.
equals
(
kurs
,
other
.
kurs
)
&&
Objects
.
equals
(
nazwa
,
other
.
nazwa
);
}
@Override
public
String
toString
()
{
return
nazwa
+
" ("
+
kod
+
"): "
+
kurs
;
}
public
BigDecimal
przeliczNaZlote
(
BigDecimal
kwota
)
{
return
null
;
}
public
BigDecimal
przeliczNaWalute
(
BigDecimal
kwotaPLN
)
{
return
null
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment