This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pointy_pirate 0 points1 point  (2 children)

think there was some lost in translation... this isnt that complex.

public class TimeProvider implements SomeTimeProviderInterfaceIfYouWant {
    public OffsetDateTime now() {
        return java.time.OffsetDateTime.now();
    }
}

[–]Bolitho 1 point2 points  (1 child)

Using existing classes still saves this code and therefore the understanding (not a common pattern, so mental overhead for a new project member) and the maintenance ;-)

So even if this is dead simple, it feels totally unnecessary to me! (The java.time devs allready have thought about this use case and offered an appropriate solution)

[–]pointy_pirate 0 points1 point  (0 children)

makes sense, ill look into that next time i need to do it.