Help I want to understant Client.java source code

I was going through the Client.java 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 Client.java 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();
ob.f();

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