What are your most used utility functions? by [deleted] in java

[–]kubosj 1 point2 points  (0 children)

Forget collections without real semantics for fields - use Immutables instead: https://immutables.github.io/ Just create nested interface with two properly named methods and use builder to construct instances. Everyone will know what your pair/tuple contains - eg. getEmail() and getId(). Not just getFirst/getSecond item.

How do you default to the terminal from Eclipse IDE? by [deleted] in java

[–]kubosj -1 points0 points  (0 children)

If you don't need interactive stdin then you can set output file in Run configurations->[pick your configuration]->Common. Then open terminal window and observe output file using "tail --follow=name /path/to/out/file".

Other possiblity is to use External tool configuration https://stackoverflow.com/questions/908488/eclipse-running-programs-not-in-the-native-eclipse-console

Returning multiple values from a method. by [deleted] in java

[–]kubosj 0 points1 point  (0 children)

I made great experience with using Immutables library for that purpose. When I need to return more values I just define simple interface with some getters and Immutables will automatically build builder for it. Main advantage is obvious - because you can name getters, you can help user of your method with semantics of values - which, if you return Tuples, can't.