Toyotomi Hideyoshi won many wars against other clans. When he made Japan one country, he developed a social caste system. This caste system was completed by Tokugawa Ieyasu and the rulers after him. Between the wars, many samurai had always worked on farms. Hideyoshi said that all samurai must either live on farms or live in castle towns with other warriors. Hideyoshi also made a law that only samurai could have swords.