Advertisement
Guest User

Untitled

a guest
Jan 10th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.35 KB | None | 0 0
  1. trait Debug {
  2.   def debugName() : Unit = {
  3.     print("Klasa: " + this.getClass.getName)
  4.   }
  5.  
  6.   def debugVars() : Unit = {
  7.     val fields = this.getClass.getDeclaredFields
  8.     for(field <- fields){
  9.       field.setAccessible(true)
  10.       print("Pole: " + field.getName + " => " + field.getType.getName + ", " + field.get(this) + "\n")
  11.     }
  12.   }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement