Translate

New Live Courses

🚀 *Gen AI Engineer Telugu (Production Focused)*
🗓️ *Date:* 30th Sept 2026, 07:00AM IST
📝 *Register Now!:*
https://www.vlrt.in/gr
👥 *Join WA Community:*
https://www.vlrt.in/gw
💡*Course Content:*
https://www.vlrt.in/ai
▶️ *Demo Videos:*
https://www.vlrt.in/gv

🚀 *Service now Admin/ Development (ITSM)FREE Demo in Telugu*
🗓️ *Date:* 30th Sept 2026, 08:00AM IST
📝 *Register Now!:*
https://www.vlrt.in/7r
👥 *Join WA Community:*
https://www.vlrt.in/7w
💡*Course Content:*
https://www.vlrt.in/7c
▶️ *Demo Videos:*
https://www.vlrt.in/7v

🚀 *Vulnerability Management Training Demo*
🗓️ *Date:* 30th Sept 2026, 09:00 AM IST
📝*Register Now!:*
https://www.vlrt.in/vr
👥 *Join Community:*
https://www.vlrt.in/cw
💡 *Course Content:*
https://www.vlrt.in/vc
▶️ *Demo Videos:*
https://www.vlrt.in/Vm

Friday, 1 October 2021

Exercise Using AST Transformations in Groovy Scripting groovy training in telugu 12

 Watch This Video

https://youtu.be/G5_aUQA41K4

---------------------------------------------------------------------------------------------------
[Exercise] Using AST Transformations
In this exercise we are going to accomplish 2 goals.

Get a little more familiar with the Groovy API Docs
Learn how to use AST Transformations
We have already shown in previous lectures the ToString and Immutable AST Transformations.
I want you to find 2 more and create either an example or examples of how to use them. Again there is no correct answer here. Browse the Groovy API Docs below and find 2 that you would like to give a test a drive.


import groovy.transform.Cannonical
@Cannonical
class Customer{
String fname,lastname
int age
Date since
Collections favItems=["Food']
def object
}

def d=new Date()
def anyObject =new Object()
def c1=new Customer(fname:"ram",lname:"krishna",age:25,since:d,favItems:["Books","Games"],object:anyObject)
fef c2=new Customer("ram","krishna",25,d,["Books","Games"],anyObject)
assert c1==c2


import groovy.transform.*

@ToString
@Sortable

class Person{
String first
String last
}
def p1=new Person(first:"joe",last:"vega")
def p2=new Person(first:"Dan",last:"vega")
def people=[p1,p2]
println people










No comments:

Post a Comment

Note: only a member of this blog may post a comment.