forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconverter.urm.puml
49 lines (49 loc) · 1.33 KB
/
converter.urm.puml
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
@startuml
package com.iluwatar.converter {
class App {
+ App()
+ main(args : String[]) {static}
}
class Converter<T, U> {
- fromDto : Function<T, U>
- fromEntity : Function<U, T>
+ Converter<T, U>(fromDto : Function<T, U>, fromEntity : Function<U, T>)
+ convertFromDto(userDto : T) : U
+ convertFromEntity(user : U) : T
+ createFromDtos(dtoUsers : Collection<T>) : List<U>
+ createFromEntities(users : Collection<U>) : List<T>
}
class User {
- firstName : String
- isActive : boolean
- lastName : String
- userId : String
+ User(firstName : String, lastName : String, isActive : boolean, userId : String)
+ equals(o : Object) : boolean
+ getFirstName() : String
+ getLastName() : String
+ getUserId() : String
+ hashCode() : int
+ isActive() : boolean
+ toString() : String
}
class UserConverter {
+ UserConverter()
}
class UserDto {
- email : String
- firstName : String
- isActive : boolean
- lastName : String
+ UserDto(firstName : String, lastName : String, isActive : boolean, email : String)
+ equals(o : Object) : boolean
+ getEmail() : String
+ getFirstName() : String
+ getLastName() : String
+ hashCode() : int
+ isActive() : boolean
+ toString() : String
}
}
UserConverter --|> Converter
@enduml