class AggregatorUtil {

    public static void populatePlainTextPasswords( Map<String, Object[]> inventoryMap )
        throws HMSRestException
    {

        if ( inventoryMap != null )
        {
            Object[] hosts = inventoryMap.get( Constants.HOSTS );
            Object[] switches = inventoryMap.get( Constants.SWITCHES );

            if ( hosts == null || switches == null )
            {
                throw new HMSRestException( Status.INTERNAL_SERVER_ERROR.getStatusCode(),
                                            "hosts/switches are null in the provided input file",
                                            "invalid inventory file" );
            }
            ObjectMapper mapper = new ObjectMapper();
            ServerNode[] serverNodes = mapper.convertValue( hosts, new TypeReference<ServerNode[]>()
            {
            } );

            SwitchNode[] switchNodes = mapper.convertValue( switches, new TypeReference<SwitchNode[]>()
            {
            } );

            decryptPassword( serverNodes );
            decryptPassword( switchNodes );

            Object[] serverNodeObj = mapper.convertValue( serverNodes, new TypeReference<Object[]>()
            {
            } );

            Object[] switchNodeObj = mapper.convertValue( switchNodes, new TypeReference<Object[]>()
            {
            } );
            inventoryMap.put( Constants.HOSTS, serverNodeObj );
            inventoryMap.put( Constants.SWITCHES, switchNodeObj );
        }
    }

}