I want to write a class diagram for a class that contains a hashmap. Normally, I would do this:
But my Map looks like this:
private Map<Beacon, String> beaconRoute;
The key is a custom class.
How can I describe it in an UML diagram?
I want to write a class diagram for a class that contains a hashmap. Normally, I would do this:
But my Map looks like this:
private Map<Beacon, String> beaconRoute;
The key is a custom class.
How can I describe it in an UML diagram?
Use
beacon : Beacon
inside the qualifier rectangle and use theString
data type as the target type (instead ofEmployee
). The propertybeaconRoute
is the association end name. You don't have to be so literal as to have a Map class in UML--doing that loses sight of the problem domain. Not that I understand why aBeacon
would map to aString
, though. Did you reverse the key and value by mistake?