/** * Obtains the current ISO local date from the specified clock. * <p> * This will query the specified clock to obtain the current date - today. * Using this method allows the use of an alternate clock for testing. * The alternate clock may be introduced using {@link Clock dependency injection}. * * @param clock the clock to use, not null * @return the current ISO local date, not null * @throws DateTimeException if unable to create the date */ @Override // override with covariant return type public LocalDate dateNow(Clock clock) { Jdk8Methods.requireNonNull(clock, "clock"); return date(LocalDate.now(clock)); }
/** * Obtains an ISO local date from the era, year-of-era, month-of-year * and day-of-month fields. * * @param era the ISO era, not null * @param yearOfEra the ISO year-of-era * @param month the ISO month-of-year * @param dayOfMonth the ISO day-of-month * @return the ISO local date, not null * @throws DateTimeException if unable to create the date */ @Override // override with covariant return type public LocalDate date(Era era, int yearOfEra, int month, int dayOfMonth) { return date(prolepticYear(era, yearOfEra), month, dayOfMonth); }
public static List<Person> createRoster() { final List<Person> roster = new ArrayList<>(); roster.add(new Person("Fred", IsoChronology.INSTANCE.date(1980, 6, 20), Person.Sex.MALE, "fred@example.com", Money.of(100000, "USD"))); roster.add(new Person("Jane", IsoChronology.INSTANCE.date(1990, 7, 15), Person.Sex.FEMALE, "jane@example.com", Money.of(80000, "USD"))); roster.add(new Person("George", IsoChronology.INSTANCE .date(1991, 8, 13), Person.Sex.MALE, "george@example.com", Money.of(70000, "USD"))); roster.add(new Person("Bob", IsoChronology.INSTANCE.date(2000, 9, 12), Person.Sex.MALE, "bob@example.com", Money.of(25000, "USD"))); return roster; }