Skip to content

Add TemporalFactories #166

@jodastephen

Description

@jodastephen

Consider adding a class TemporalFactories (name TBD). It would have factory methods for all temporal classes across java.time and ThreeTen-Extra. The crucial difference would be that such a class would be designed for static imports:

public class TemporalFactories {
  public LocalDate date(int,int,int);
  public LocalDate date(int,Month,int);
  public LocalDate date(int,MonthDay);
  public LocalDate date(int,int);
  public LocalDate date(Year,int,int);
  public LocalDate date(Year,Month,int);
  public LocalDate date(Year,MonthDay);
  public LocalDate date(Year,int);
  public LocalDate date(String);  // parse
  // and so on for other types
}
// usage
callMethod(date(2020, 6, 12));

Originally suggested in #155

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions