Skip to content

Commit d93c79e

Browse files
committed
Request to Persian Translation iluwatar#3035
Made a new file (localization/ir/README.md) Specifically for the Persian Translation
1 parent 8bd3175 commit d93c79e

File tree

11 files changed

+594
-0
lines changed

11 files changed

+594
-0
lines changed

Diff for: fluent-interface/etc/fluent-interface.urm.puml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
@startuml
2+
package com.iluwatar.fluentinterface.fluentiterable.simple {
3+
class SimpleFluentIterable<E> {
4+
- iterable : Iterable<E>
5+
+ SimpleFluentIterable<E>(iterable : Iterable<E>)
6+
+ asList() : List<E>
7+
+ filter(predicate : Predicate<? super E>) : FluentIterable<E>
8+
+ first() : Optional<E>
9+
+ first(count : int) : FluentIterable<E>
10+
+ forEach(action : Consumer<? super E>)
11+
+ from(iterable : Iterable<E>) : FluentIterable<E> {static}
12+
+ fromCopyOf(iterable : Iterable<E>) : FluentIterable<E> {static}
13+
+ getRemainingElementsCount() : int
14+
+ iterator() : Iterator<E>
15+
+ last() : Optional<E>
16+
+ last(count : int) : FluentIterable<E>
17+
+ map(function : Function<? super E, T>) : FluentIterable<T>
18+
+ spliterator() : Spliterator<E>
19+
+ toList(iterator : Iterator<E>) : List<E> {static}
20+
}
21+
}
22+
package com.iluwatar.fluentinterface.app {
23+
class App {
24+
- LOGGER : Logger {static}
25+
+ App()
26+
+ main(args : String[]) {static}
27+
- negatives() : Predicate<? super Integer> {static}
28+
- positives() : Predicate<? super Integer> {static}
29+
- prettyPrint(delimiter : String, prefix : String, iterable : Iterable<E>) {static}
30+
- prettyPrint(prefix : String, iterable : Iterable<E>) {static}
31+
- transformToString() : Function<Integer, String> {static}
32+
}
33+
}
34+
package com.iluwatar.fluentinterface.fluentiterable.lazy {
35+
abstract class DecoratingIterator<E> {
36+
# fromIterator : Iterator<E>
37+
- next : E
38+
+ DecoratingIterator<E>(fromIterator : Iterator<E>)
39+
+ computeNext() : E {abstract}
40+
+ hasNext() : boolean
41+
+ next() : E
42+
}
43+
class LazyFluentIterable<E> {
44+
- iterable : Iterable<E>
45+
# LazyFluentIterable<E>()
46+
+ LazyFluentIterable<E>(iterable : Iterable<E>)
47+
+ asList() : List<E>
48+
+ filter(predicate : Predicate<? super E>) : FluentIterable<E>
49+
+ first() : Optional<E>
50+
+ first(count : int) : FluentIterable<E>
51+
+ from(iterable : Iterable<E>) : FluentIterable<E> {static}
52+
+ iterator() : Iterator<E>
53+
+ last() : Optional<E>
54+
+ last(count : int) : FluentIterable<E>
55+
+ map(function : Function<? super E, T>) : FluentIterable<T>
56+
}
57+
}
58+
package com.iluwatar.fluentinterface.fluentiterable {
59+
interface FluentIterable<E> {
60+
+ asList() : List<E> {abstract}
61+
+ copyToList(iterable : Iterable<E>) : List<E> {static}
62+
+ filter(Predicate<? super E>) : FluentIterable<E> {abstract}
63+
+ first() : Optional<E> {abstract}
64+
+ first(int) : FluentIterable<E> {abstract}
65+
+ last() : Optional<E> {abstract}
66+
+ last(int) : FluentIterable<E> {abstract}
67+
+ map(Function<? super E, T>) : FluentIterable<T> {abstract}
68+
}
69+
}
70+
LazyFluentIterable ..|> FluentIterable
71+
SimpleFluentIterable ..|> FluentIterable
72+
@enduml
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@startuml
2+
package com.iluwatar.function.composition {
3+
class App {
4+
+ App()
5+
+ main(args : String[]) {static}
6+
}
7+
class FunctionComposer {
8+
+ FunctionComposer()
9+
+ composeFunctions(f1 : Function<Integer, Integer>, f2 : Function<Integer, Integer>) : Function<Integer, Integer> {static}
10+
}
11+
}
12+
@enduml
+282
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,282 @@
1+
@startuml
2+
package com.iluwatar.hexagonal.sampledata {
3+
class SampleData {
4+
- PLAYERS : List<PlayerDetails> {static}
5+
- RANDOM : SecureRandom {static}
6+
+ SampleData()
7+
- getRandomPlayerDetails() : PlayerDetails {static}
8+
+ submitTickets(lotteryService : LotteryService, numTickets : int) {static}
9+
}
10+
}
11+
package com.iluwatar.hexagonal.service {
12+
class ConsoleLottery {
13+
- LOGGER : Logger {static}
14+
+ ConsoleLottery()
15+
+ main(args : String[]) {static}
16+
- printMainMenu() {static}
17+
- readString(scanner : Scanner) : String {static}
18+
}
19+
interface LotteryConsoleService {
20+
+ addFundsToLotteryAccount(WireTransfers, Scanner) {abstract}
21+
+ checkTicket(LotteryService, Scanner) {abstract}
22+
+ queryLotteryAccountFunds(WireTransfers, Scanner) {abstract}
23+
+ submitTicket(LotteryService, Scanner) {abstract}
24+
}
25+
class LotteryConsoleServiceImpl {
26+
- logger : Logger
27+
+ LotteryConsoleServiceImpl(logger : Logger)
28+
+ addFundsToLotteryAccount(bank : WireTransfers, scanner : Scanner)
29+
+ checkTicket(service : LotteryService, scanner : Scanner)
30+
+ queryLotteryAccountFunds(bank : WireTransfers, scanner : Scanner)
31+
- readString(scanner : Scanner) : String
32+
+ submitTicket(service : LotteryService, scanner : Scanner)
33+
}
34+
}
35+
package com.iluwatar.hexagonal.mongo {
36+
class MongoConnectionPropertiesLoader {
37+
- DEFAULT_HOST : String {static}
38+
- DEFAULT_PORT : int {static}
39+
- LOGGER : Logger {static}
40+
+ MongoConnectionPropertiesLoader()
41+
+ load() {static}
42+
}
43+
}
44+
package com.iluwatar.hexagonal.domain {
45+
class LotteryAdministration {
46+
- notifications : LotteryEventLog
47+
- repository : LotteryTicketRepository
48+
- wireTransfers : WireTransfers
49+
+ LotteryAdministration(repository : LotteryTicketRepository, notifications : LotteryEventLog, wireTransfers : WireTransfers)
50+
+ getAllSubmittedTickets() : Map<LotteryTicketId, LotteryTicket>
51+
+ performLottery() : LotteryNumbers
52+
+ resetLottery()
53+
}
54+
class LotteryConstants {
55+
+ PLAYER_MAX_BALANCE : int {static}
56+
+ PRIZE_AMOUNT : int {static}
57+
+ SERVICE_BANK_ACCOUNT : String {static}
58+
+ SERVICE_BANK_ACCOUNT_BALANCE : int {static}
59+
+ TICKET_PRIZE : int {static}
60+
- LotteryConstants()
61+
}
62+
class LotteryNumbers {
63+
+ MAX_NUMBER : int {static}
64+
+ MIN_NUMBER : int {static}
65+
+ NUM_NUMBERS : int {static}
66+
- numbers : Set<Integer>
67+
- LotteryNumbers()
68+
- LotteryNumbers(givenNumbers : Set<Integer>)
69+
# canEqual(other : Object) : boolean
70+
+ create(givenNumbers : Set<Integer>) : LotteryNumbers {static}
71+
+ createRandom() : LotteryNumbers {static}
72+
+ equals(o : Object) : boolean
73+
- generateRandomNumbers()
74+
+ getNumbers() : Set<Integer>
75+
+ getNumbersAsString() : String
76+
+ hashCode() : int
77+
+ toString() : String
78+
}
79+
-class RandomNumberGenerator {
80+
- randomIterator : OfInt
81+
+ RandomNumberGenerator(min : int, max : int)
82+
+ nextInt() : int
83+
}
84+
class LotteryService {
85+
- notifications : LotteryEventLog
86+
- repository : LotteryTicketRepository
87+
- wireTransfers : WireTransfers
88+
+ LotteryService(repository : LotteryTicketRepository, notifications : LotteryEventLog, wireTransfers : WireTransfers)
89+
+ checkTicketForPrize(id : LotteryTicketId, winningNumbers : LotteryNumbers) : LotteryTicketCheckResult
90+
+ submitTicket(ticket : LotteryTicket) : Optional<LotteryTicketId>
91+
}
92+
class LotteryTicketCheckResult {
93+
- prizeAmount : int
94+
- result : CheckResult
95+
+ LotteryTicketCheckResult(result : CheckResult)
96+
+ LotteryTicketCheckResult(result : CheckResult, prizeAmount : int)
97+
# canEqual(other : Object) : boolean
98+
+ equals(o : Object) : boolean
99+
+ getPrizeAmount() : int
100+
+ getResult() : CheckResult
101+
+ hashCode() : int
102+
}
103+
enum CheckResult {
104+
+ NO_PRIZE {static}
105+
+ TICKET_NOT_SUBMITTED {static}
106+
+ WIN_PRIZE {static}
107+
+ valueOf(name : String) : CheckResult {static}
108+
+ values() : CheckResult[] {static}
109+
}
110+
class LotteryTicketId {
111+
- id : int
112+
- numAllocated : AtomicInteger {static}
113+
+ LotteryTicketId()
114+
+ LotteryTicketId(id : int)
115+
# canEqual(other : Object) : boolean
116+
+ equals(o : Object) : boolean
117+
+ getId() : int
118+
+ hashCode() : int
119+
+ toString() : String
120+
}
121+
class LotteryUtils {
122+
- LotteryUtils()
123+
+ checkTicketForPrize(repository : LotteryTicketRepository, id : LotteryTicketId, winningNumbers : LotteryNumbers) : LotteryTicketCheckResult {static}
124+
}
125+
}
126+
package com.iluwatar.hexagonal.banking {
127+
class InMemoryBank {
128+
- accounts : Map<String, Integer> {static}
129+
+ InMemoryBank()
130+
+ getFunds(bankAccount : String) : int
131+
+ setFunds(bankAccount : String, amount : int)
132+
+ transferFunds(amount : int, sourceAccount : String, destinationAccount : String) : boolean
133+
}
134+
class MongoBank {
135+
- DEFAULT_ACCOUNTS_COLLECTION : String {static}
136+
- DEFAULT_DB : String {static}
137+
- accountsCollection : MongoCollection<Document>
138+
- database : MongoDatabase
139+
- mongoClient : MongoClient
140+
+ MongoBank()
141+
+ MongoBank(dbName : String, accountsCollectionName : String)
142+
+ connect()
143+
+ connect(dbName : String, accountsCollectionName : String)
144+
+ getAccountsCollection() : MongoCollection<Document>
145+
+ getDatabase() : MongoDatabase
146+
+ getFunds(bankAccount : String) : int
147+
+ getMongoClient() : MongoClient
148+
+ setFunds(bankAccount : String, amount : int)
149+
+ transferFunds(amount : int, sourceAccount : String, destinationAccount : String) : boolean
150+
}
151+
interface WireTransfers {
152+
+ getFunds(String) : int {abstract}
153+
+ setFunds(String, int) {abstract}
154+
+ transferFunds(int, String, String) : boolean {abstract}
155+
}
156+
}
157+
package com.iluwatar.hexagonal.database {
158+
class InMemoryTicketRepository {
159+
- tickets : Map<LotteryTicketId, LotteryTicket> {static}
160+
+ InMemoryTicketRepository()
161+
+ deleteAll()
162+
+ findAll() : Map<LotteryTicketId, LotteryTicket>
163+
+ findById(id : LotteryTicketId) : Optional<LotteryTicket>
164+
+ save(ticket : LotteryTicket) : Optional<LotteryTicketId>
165+
}
166+
interface LotteryTicketRepository {
167+
+ deleteAll() {abstract}
168+
+ findAll() : Map<LotteryTicketId, LotteryTicket> {abstract}
169+
+ findById(LotteryTicketId) : Optional<LotteryTicket> {abstract}
170+
+ save(LotteryTicket) : Optional<LotteryTicketId> {abstract}
171+
}
172+
class MongoTicketRepository {
173+
- DEFAULT_COUNTERS_COLLECTION : String {static}
174+
- DEFAULT_DB : String {static}
175+
- DEFAULT_TICKETS_COLLECTION : String {static}
176+
- TICKET_ID : String {static}
177+
- countersCollection : MongoCollection<Document>
178+
- database : MongoDatabase
179+
- mongoClient : MongoClient
180+
- ticketsCollection : MongoCollection<Document>
181+
+ MongoTicketRepository()
182+
+ MongoTicketRepository(dbName : String, ticketsCollectionName : String, countersCollectionName : String)
183+
+ connect()
184+
+ connect(dbName : String, ticketsCollectionName : String, countersCollectionName : String)
185+
+ deleteAll()
186+
- docToTicket(doc : Document) : LotteryTicket
187+
+ findAll() : Map<LotteryTicketId, LotteryTicket>
188+
+ findById(id : LotteryTicketId) : Optional<LotteryTicket>
189+
+ getCountersCollection() : MongoCollection<Document>
190+
+ getNextId() : int
191+
+ getTicketsCollection() : MongoCollection<Document>
192+
- initCounters()
193+
+ save(ticket : LotteryTicket) : Optional<LotteryTicketId>
194+
}
195+
}
196+
package com.iluwatar.hexagonal {
197+
class App {
198+
+ App()
199+
+ main(args : String[]) {static}
200+
}
201+
}
202+
package com.iluwatar.hexagonal.administration {
203+
class ConsoleAdministration {
204+
- LOGGER : Logger {static}
205+
+ ConsoleAdministration()
206+
+ main(args : String[]) {static}
207+
- printMainMenu() {static}
208+
- readString(scanner : Scanner) : String {static}
209+
}
210+
interface ConsoleAdministrationSrv {
211+
+ getAllSubmittedTickets() {abstract}
212+
+ performLottery() {abstract}
213+
+ resetLottery() {abstract}
214+
}
215+
class ConsoleAdministrationSrvImpl {
216+
- administration : LotteryAdministration
217+
- logger : Logger
218+
+ ConsoleAdministrationSrvImpl(administration : LotteryAdministration, logger : Logger)
219+
+ getAllSubmittedTickets()
220+
+ performLottery()
221+
+ resetLottery()
222+
}
223+
}
224+
package com.iluwatar.hexagonal.eventlog {
225+
interface LotteryEventLog {
226+
+ prizeError(PlayerDetails, int) {abstract}
227+
+ ticketDidNotWin(PlayerDetails) {abstract}
228+
+ ticketSubmitError(PlayerDetails) {abstract}
229+
+ ticketSubmitted(PlayerDetails) {abstract}
230+
+ ticketWon(PlayerDetails, int) {abstract}
231+
}
232+
class MongoEventLog {
233+
- DEFAULT_DB : String {static}
234+
- DEFAULT_EVENTS_COLLECTION : String {static}
235+
- EMAIL : String {static}
236+
+ MESSAGE : String {static}
237+
- PHONE : String {static}
238+
- database : MongoDatabase
239+
- eventsCollection : MongoCollection<Document>
240+
- mongoClient : MongoClient
241+
- stdOutEventLog : StdOutEventLog
242+
+ MongoEventLog()
243+
+ MongoEventLog(dbName : String, eventsCollectionName : String)
244+
+ connect()
245+
+ connect(dbName : String, eventsCollectionName : String)
246+
+ getDatabase() : MongoDatabase
247+
+ getEventsCollection() : MongoCollection<Document>
248+
+ getMongoClient() : MongoClient
249+
+ prizeError(details : PlayerDetails, prizeAmount : int)
250+
+ ticketDidNotWin(details : PlayerDetails)
251+
+ ticketSubmitError(details : PlayerDetails)
252+
+ ticketSubmitted(details : PlayerDetails)
253+
+ ticketWon(details : PlayerDetails, prizeAmount : int)
254+
}
255+
class StdOutEventLog {
256+
- LOGGER : Logger {static}
257+
+ StdOutEventLog()
258+
+ prizeError(details : PlayerDetails, prizeAmount : int)
259+
+ ticketDidNotWin(details : PlayerDetails)
260+
+ ticketSubmitError(details : PlayerDetails)
261+
+ ticketSubmitted(details : PlayerDetails)
262+
+ ticketWon(details : PlayerDetails, prizeAmount : int)
263+
}
264+
}
265+
LotteryAdministration --> "-wireTransfers" WireTransfers
266+
LotteryService --> "-notifications" LotteryEventLog
267+
LotteryAdministration --> "-repository" LotteryTicketRepository
268+
MongoEventLog --> "-stdOutEventLog" StdOutEventLog
269+
LotteryService --> "-wireTransfers" WireTransfers
270+
LotteryAdministration --> "-notifications" LotteryEventLog
271+
ConsoleAdministrationSrvImpl --> "-administration" LotteryAdministration
272+
LotteryService --> "-repository" LotteryTicketRepository
273+
LotteryTicketCheckResult --> "-result" CheckResult
274+
ConsoleAdministrationSrvImpl ..|> ConsoleAdministrationSrv
275+
InMemoryBank ..|> WireTransfers
276+
MongoBank ..|> WireTransfers
277+
InMemoryTicketRepository ..|> LotteryTicketRepository
278+
MongoTicketRepository ..|> LotteryTicketRepository
279+
MongoEventLog ..|> LotteryEventLog
280+
StdOutEventLog ..|> LotteryEventLog
281+
LotteryConsoleServiceImpl ..|> LotteryConsoleService
282+
@enduml

0 commit comments

Comments
 (0)