[No Audio]
At this point. As a general point, it kind of feels
a bit dirty that we just copied and pasted that method.
So don't do that. Instead,
what I would do is I'd basically take this,
create another method
[No Audio]
and say call this,
[No Audio]
getUsersByUserTypes, user type
I’ll probably make this private
[No Audio]
and pass in UserType
[No Audio]
enum, just import
that and then I would use that here.
[No Audio]
And in doing so we can replace them,
these implementations, I can just replace these
now we've returned
this more generic method,
getUsersByUserType(User.UserType.ADMIN_USER
and similarly I could do the same thing here.
[No Audio]
Type.REGULAR_USER. That's good.
I don't feel as dirty now.
Everything's dry.
They don't repeat yourself principle.
Do not have duplicate curve blocks that's much nicer.
Control Alt R to tidy up any imports
if we need to, which we don't. But it's
a nice thing to just get into the habit of doing it.
Makes things neater and tidier as we go along.
But anyway, now we've kept things nice and dry.
That's the don't repeat yourself principle,
where we're not repeating code or
just mindlessly copying pasting code.
And we've made it now such that we have
a parameter driven method which is much nicer.
So let's move on.