Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait Debug{
- def debugName = "Klasa: "+this.getClass.getName
- def debugFields=
- {
- val list=this.getClass.getDeclaredFields
- for(x <- list ){
- {println("Pole:"+ x.getName() +" => "+x.getType.toString())}
- }
- }
- def debugVars=
- {
- val list=this.getClass.getDeclaredFields
- for(x <- list ){
- x.setAccessible(true)
- println("Pole:"+ x.getName+" =>"+x.get(this))
- }
- }
- }
- class Point(xv: Int, yv: Int) extends Debug {
- var x: Int = xv
- var y: Int = yv
- var a: String = "test"
- }
- var p2: Point = new Point(3,4)
- p2.debugFields
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement