Monday 25 September 2023

PlantUML: Object Diagram with Map or Associative Array

You can define a map or associate using 'map' keyword. Following example demonstrate different ways to define the map.

map.txt

@startuml

title "Object Association"

map CountryCapitals1 {
	India => New Delhi
	Russia => Moscow
	Germany => Berlin
}

map "Map **ContryName => CapitalCity**" as CountryCapitals2 {
	India => New Delhi
	Russia => Moscow
	Germany => Berlin
}

map "map: Map<String, String>" as CountryCapitals3 {
	India => New Delhi
	Russia => Moscow
	Germany => Berlin
}

@enduml

 

Above snippet generate below diagram.

 


 

Previous                                                    Next                                                    Home

No comments:

Post a Comment