Break with Any closer in Groovy

class DeleteItDemoTest {

static main(args) {

DeleteItDemoTest test = new DeleteItDemoTest()
boolean res=test.isValidUser()
println "result is "+res


def isValidUser() {
def validRoleList = [

def roles = ["ODREADUSER","ODConfidentialUser1","OBDUser"]
println"Role of AMITG==============>"+roles

def authorizedUser = false
if(it in validRoleList) {
authorizedUser = true
println "authorized user for action"+it
authorizedUser = false
println "unauthorized useuer for action"+it
return authorizedUser



Popular posts from this blog

Conversion from Clob To String in java and Vice versa

Portable Java 8/ JDK8 setup without admin rights

Multi Threading , Producer consumer problem in Java