Help I want to understant source code

(Manish Kumar) #1

I was going through the source code just to learn coding.

lets take on method as example

client.prepareIndex(index, type)

Its return type is IndexRequestBuilder. My question is in its simply

> IndexRequestBuilder prepareIndex(String index, String type);

So where is the implementation for this method ? When I call client.prepareIndex(index, type) which implementation is called and why it written like this ?

What i know from my knowledge about using interface is something like this :

publi interface Y
  public void f();

publi class X implements Y
      public void f()
            // .....

Now I call it like

Y ob = new X();

But in ES when i call some method I am not understanding how it resolve the method call and where is the method implementation of

(system) #2