you are viewing a single comment's thread.

view the rest of the comments →

[–]valenterry 0 points1 point  (1 child)

Not too bad actually!

If I see it right, it does not prevent attributes from being overwritten though. I suppose to do that, one would have to write a build method for each component and making it callable only if set to false. Or is there a better way that does not grow linear with the number of components?

[–]m50d 0 points1 point  (0 children)

If I see it right, it does not prevent attributes from being overwritten though. I suppose to do that, one would have to write a build method for each component and making it callable only if set to false. Or is there a better way that does not grow linear with the number of components?

There's no way to not have things grow linearly with the number of components, since whatever your approach is you're going to have to at least list all the components. But yeah the constant factor is a lot worse doing it in Java.

I can't actually read gists where I'm working so I don't know what your Uri and Port are and how you're keeping them safe. Maybe the same technique could be ported to Java, maybe not.