Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2241

Javadocs for CS Collectors with examples

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 8.1.0.Final
    • None
    • optaplanner-core
    • None

      • All ConstraintCollectors methods should be javadocced.
      • Most can use our standard "As definied by ..." trick, toward the base one which is fully javadocced.
        • for countDistinct(), I think the base should be countDistinct(Function), not countDistinct()
      • The base methods should use examples to avoid confusion. For example:
        • For example javadoc of count:
          from([Person("Ann", "Cole", 20), Person("Beth", "Cole", 20), Person("Carl", "Cole", 22), Person("Dan", "Jones", 20)]
          .groupBy(Person::getLastName, count()) returns [{"Cole", 3}, {"Jones", 1}]
        • For example javadoc of countDistinct:
          from([Person("Ann", "Cole", 20), Person("Beth", "Cole", 20), Person("Carl", "Cole", 30), Person("Dan", "Jones", 20)]
          .groupBy(Person::getLastName, countDistinct(Person::getAge)) returns [{"Cole", 2}, {"Jones", 1}]
      • All examples should use our CS streams example conventions (the ones above might not, but I think they do). IIRC, that means similar to JSON: [] for collections, {} for objects, () for method calls.

      See discussion: https://stackoverflow.com/questions/64695627/count-vs-countdistinct-in-optaplanner

            lpetrovi@redhat.com Lukáš Petrovický (Inactive)
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: