SPARK-2745 [STREAMING] Add Java friendly methods to Duration class

@tdas is this what you had in mind for this JIRA? I saw this one and thought it would be easy to take care of, and helpful as I use streaming from Java.

I could do the same for `Time`? Happy to do so.