Skip to content

Latest commit

 

History

History
134 lines (100 loc) · 2.83 KB

CONTRIBUTING.md

File metadata and controls

134 lines (100 loc) · 2.83 KB

Contributing

Pull requests welcomed!

Please run any nontrivial contribution ideas by the project maintainer, hiljusti, before sending a PR.

Evil

Some code may need to be evil, and if so, should be marked with @Evil.

This is an example of a neutral combination:

Function<A, B> + Function <B, C> = Function<A, C>

Assuming both functions are pure, it has a clear flow and nothing is hidden.

This, on the other hand, is an example of an evil combination:

Consumer<A> + Supplier<B> = Function<A, B>

There is no direct relation between the void return of the Consumer and the no-args invocation of the Supplier. This can usually be understood as a code smell. Something is being done in that Consumer (a network call, something in a thread, a mutating action) that may now be hidden from the end caller.

Evil functions or collections of functions can be a sign of either

  1. Evil code is being written, or
  2. Code is interacting with something evil

Ordering

Because alphabetic ordering may be difficult to grok, the project follows the following ordering. Classes may be omitted when there is no benefit, or a different class also matches, and there's no benefit to specificity.

Values family

  1. Object
  2. boolean
  3. double
  4. int
  5. long

Function family

  1. Function
  2. BiFunction
  3. BooleanFunction (Z)
  4. BooleanToDoubleFunction (Z)
  5. BooleanToIntFunction (Z)
  6. BooleanToLongFunction (Z)
  7. DoubleFunction
  8. DoubleToIntFunction
  9. DoubleToLongFunction
  10. ToDoubleFunction
  11. ToDoubleBiFunction
  12. IntFunction
  13. IntToDoubleFunction
  14. IntToLongFunction
  15. ToIntFunction
  16. ToIntBiFunction
  17. LongFunction
  18. LongToDoubleFunction
  19. LongToIntFunction
  20. ToLongFunction
  21. ToLongBiFunction

Predicate family

  1. Predicate
  2. BiPredicate
  3. BooleanPredicate (Z)
  4. DoublePredicate
  5. IntPredicate
  6. LongPredicate

Consumer family

  1. Consumer
  2. BiConsumer
  3. BooleanConsumer (Z)
  4. DoubleConsumer
  5. ObjDoubleConsumer
  6. IntConsumer
  7. ObjIntConsumer
  8. LongConsumer
  9. ObjLongConsumer

Supplier Family

  1. Supplier
  2. BooleanSupplier
  3. DoubleSupplier
  4. IntSupplier
  5. LongSupplier

Operator Family

  1. Operator (Z)
  2. UnaryOperator
  3. BinaryOperator
  4. DoubleUnaryOperator
  5. DoubleBinaryOperator
  6. IntUnaryOperator
  7. IntBinaryOperator
  8. LongUnaryOperator
  9. LongBinaryOperator

Z Multifunction Family

  1. TriFunction
  2. QuadFunction
  3. QuinFunction
  4. SexFunction
  5. SeptFunction
  6. OctFunction
  7. NonFunction
  8. DecFunction
  9. UndecFunction
  10. DodecFunction

Testing

Usage examples in tests are welcomed, unit tests are required.

Any PR must continue to compile and pass tests.

Publishing

Publishing to Maven Central is currently handled by hiljusti.

The staging repository (prior to release to maven central) is at: https://s01.oss.sonatype.org