I would say that the figurative language used is OXYMORON.
This is because of the term "banana ripe and green". The words ripe and green with regards to banana is contradictory. We know that a banana is ripe because its color turns from green(unripe) to yellow.
Other examples of oxymoron that we encounter every day without us knowing are:
-same difference
-deafening silence
-appear invisible
Oxymorons are used for dramatic effect. It is used to add flavor in the speech and provide entertainment to its recipient.