I'd like to re-implement a method of a Java class. For example, for "hi".length()
to return 4
. (How) Can I do that?
I know using SomeClass.metaClass I can get a reference to an existing method and define new (or overriding) method, but I can't seem to be able to do that for existing Java methods.