Yes, in Scala there is a type of class called a 'case class'. This creates a 'companion' object with the same name and an apply method. Companion object means: an object with the same name that can be accessed in a static fashion. The apply method is executed if you call a method without a name on an object.
The call class is defined like this: case class Call(method: String, url: String) { }
The equivalent of this without the case keyword would be a class and an object:
class Call(method: String, url: String) { }
object Call {
def apply(method: String, url:String):Call = new Call(method, url)
}
This means that Call(..., ...) has the same result as new Call(..., ...), which is an instance of Call.
My guess is that the Java equivalent would look something like this:
new Call(request.method(), request.path() + "?" + request.rawQueryString())
Erik