forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonad.urm.puml
More file actions
35 lines (35 loc) · 855 Bytes
/
monad.urm.puml
File metadata and controls
35 lines (35 loc) · 855 Bytes
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
@startuml
package com.iluwatar.monad {
class Validator<T> {
- exceptions : List<Throwable>
- t : T
- Validator<T>(t : T)
+ get() : T
+ of(t : T) : Validator<T> {static}
+ validate(projection : Function<T, U>, validation : Predicate<U>, message : String) : Validator<T>
+ validate(validation : Predicate<T>, message : String) : Validator<T>
}
class App {
+ App()
+ main(args : String[]) {static}
}
class User {
- age : int
- email : String
- name : String
- sex : Sex
+ User(name : String, age : int, sex : Sex, email : String)
+ getAge() : int
+ getEmail() : String
+ getName() : String
+ getSex() : Sex
}
enum Sex {
+ FEMALE {static}
+ MALE {static}
+ valueOf(name : String) : Sex {static}
+ values() : Sex[] {static}
}
}
User --> "-sex" Sex
@enduml