During the Edo period, there were hardly a consciousness of "Japanese" among the people of Japan, they were mostly considered to be subjects of the regional feudal domains called the Han, and the people were loyal to their feudal lords.
During the era of Japanese modernization, most of them went to Germany to study abroad, and they were heavily influenced by Nazi Germany, as Nazism was influential then. When they returned home, they went onto influence the politics of Japan, which were Japanese ultranationalism and Japanese fascism.
On a related note, I think countries like Germany, Italy and Japan went with the path of ethnic nations, because historically they were so late to the game of state modernization. While countries like France, England and China already had the political systems in its place to modernize and unify the state without having to resort to the idea of ethnicity to unify its people.
Historians Hans Kohn, Liah Greenfeld, Philip White and others have classified nations such as Germany or Italy, where cultural unification preceded state unification, as ethnic nations or ethnic nationalities. However, "state-driven" national unifications, such as in France, England or China, are more likely to flourish in multiethnic societies, producing a traditional national heritage of civic nations, or territory-based nationalities.Germany had of course, completely rejected the idea of an ethnic nation after the defeat of Nazism. It's highly unlikely that any modern Western nation will ever go back to it. Especially for the countries that historically have had the process of state unification before cultural unification, I don't think that it's even in the political consciousness of those countries.The relation between racism and ethnic nationalism reached its height in the 20th century fascism and Nazism. The specific combination of "nation" ("people") and "state" expressed in such terms as the Völkische Staat and implemented in laws such as the 1935 Nuremberg laws made fascist states such as early Nazi Germany qualitatively different from non-fascist nation states. Minorities were not considered part of the people (Volk), and were consequently denied to have an authentic or legitimate role in such a state. In Germany, neither Jews nor the Roma were considered part of the people and were specifically targeted for persecution. German nationality law defined "German" on the basis of German ancestry, excluding all non-Germans from the people.
The point of ethnic consciousness is a strawman. The history of the Edo period itself goes to show that a general attitude of isolation from world affairs in Japan long predates their exposure to Third Reich ideas during the Meiji Restoration, and their modern attitudes are just as likely influenced by these long, deep-seated notions about their nation's role in the world, as they are by the following period, if not more.
Also, contrast the relative prosperity that the average peasant in the Edo period had under the isolationist social structure, than the typical plight of the peasant in most other periods of an east asian society.
Contrast that with the pressure under which the modern Japanese citizen lives, but also scale the relative standard of living with that of most developed countries in this same era. For the time and region, it's likely that the average citizen in the Edo period had it "good," and for the standard these days, in contrast to other developed countries around the world, the average Japanese citizen now has it rather "bad."
Given how relatively prosperous for its time the Tokogawa Shogunate's policy of isolationism made its country, we could take a lesson or two from their probable line of thinking. And at any rate, the modern incarnations of Japan and China are set to outlast our own civilization regardless.