To the medieval Japanese samurai their ethics were derived from their set of rules on how to act, this was called Bushido. In Europe, the military class consisting of knights called the Code of Chivalry, Bushido was the Japanese equivalent. Bushido literally translates to "the way of the warrior", the way of the warrior was the was the military class lived their lives. Their collective values, teachings, and ideals were given the term Bushido during Edo-period Japan. Bushido called for samurai to have a lot of different qualities, valor, courage, respect, but the most important were honor and a samurai's duty to his lord. Yamaga Soko was the scholar who finalized and made the legitimate written record of the Bushido code, his idea of the samurai was centralized on the idea that his duty to his lord came above everything else in life.
Samurai ethics were not the same continuously throughout Japanese history, the values and morals changed with each era. During the Heian period, samurai focused on their family honor, and then their loyalty to their lords, and finally they did have regard for their personal benefits. However, by the Kamakura period, samurai were less interested in honor and personal benefits and mainly focused on the professional aspect. In other terms, they focused on fighting wars, and settling political unrest. Another main aspect of samurai ethics was the act of committing seppuku, or belly cutting. Seppuku was the ultimate way of an honorable death, if a samurai had suffered a loss in a battle or has lost his honor; he would then proceed to slice his abdomen open with his sword. Samurai had a specific way of life, and not all the normal beings could survive in the military class, in which honor and duty to one's lord was the most important thing in life.