@startuml package com.iluwatar.promise { class App { - DEFAULT_URL : String {static} - LOGGER : Logger {static} - executor : ExecutorService - stopLatch : CountDownLatch - App() - calculateLineCount() - calculateLowestFrequencyChar() - characterFrequency() : Promise> - countLines() : Promise - download(urlString : String) : Promise - lowestFrequencyChar() : Promise + main(args : String[]) {static} - promiseUsage() - stop() - taskCompleted() } class Promise { - exceptionHandler : Consumer - fulfillmentAction : Runnable + Promise() + fulfill(value : T) + fulfillExceptionally(exception : Exception) + fulfillInAsync(task : Callable, executor : Executor) : Promise - handleException(exception : Exception) + onError(exceptionHandler : Consumer) : Promise - postFulfillment() + thenAccept(action : Consumer) : Promise + thenApply(func : Function) : Promise } -class ConsumeAction { - action : Consumer - dest : Promise - src : Promise - ConsumeAction(src : Promise, dest : Promise, action : Consumer) + run() } -class TransformAction { - dest : Promise - func : Function - src : Promise - TransformAction(src : Promise, dest : Promise, func : Function) + run() } ~class PromiseSupport { - COMPLETED : int {static} - FAILED : int {static} - LOGGER : Logger {static} - RUNNING : int {static} - exception : Exception - lock : Object - state : int - value : T ~ PromiseSupport() + cancel(mayInterruptIfRunning : boolean) : boolean ~ fulfill(value : T) ~ fulfillExceptionally(exception : Exception) + get() : T + get(timeout : long, unit : TimeUnit) : T + isCancelled() : boolean + isDone() : boolean } class Utility { - LOGGER : Logger {static} + Utility() + characterFrequency(fileLocation : String) : Map {static} + countLines(fileLocation : String) : Integer {static} + downloadFile(urlString : String) : String {static} + lowestFrequencyChar(charFrequency : Map) : Character {static} } } TransformAction --+ Promise TransformAction --> "-src" Promise ConsumeAction --+ Promise ConsumeAction --> "-src" Promise Promise --|> PromiseSupport @enduml