Skip to content

skh:tec

steven k hicks: the exception catcher

Groovy Tip of the Day: Getters and Setters aliases

The syntax:

testPerson.address.state.length 

Translates into the equivalent call in Java:

Person::getAddress().getState().getLength

If you were to place an assignment operator at the end and a value (= 5), then the call to getLength would become a setLength.

Author shicksPosted on 24 April 2016Tags groovy, java

Post navigation

Previous Previous post: Simple tip to take better pictures with an Android Phone
Next Next post: The Scalafication of Java Libraries

Follow Me

  • Twitter
  • RSS Feed

Tags

  • akka (4)
  • apache (4)
  • bash (5)
  • books (14)
  • build systems (4)
  • chicago (4)
  • computer science (6)
  • development (54)
  • docker (5)
  • documentation (7)
  • essay (10)
  • flying (4)
  • food (4)
  • gentoo (5)
  • github (10)
  • grails (4)
  • groovy (15)
  • java (36)
  • linux (23)
  • market (5)
  • maven (13)
  • opensource (11)
  • open source (4)
  • opinion (16)
  • productivity (5)
  • products (6)
  • python (4)
  • rant (4)
  • rants (22)
  • rest (4)
  • reviews (12)
  • ruby (4)
  • scala (12)
  • self improvement (10)
  • software (44)
  • ssh (6)
  • ssh-copy-id (4)
  • talks (5)
  • technical (32)
  • technology (24)
  • testing (13)
  • tools (13)
  • trains (4)
  • travel (9)
  • unittesting (6)

Blogroll

  • Antipaucity
  • Jin Fury's Rageaton

Personal

  • SKH.co.uk [Personal Site]
  • SKH.de [Personal Site]
  • TEC.com [Personal Site]
skh:tec Proudly powered by WordPress