Been searching Google/stackoverflow with various terms but they all are way too broad to pinpoint what I’m trying to find.
I am just looking at some AWS API code and want to read up on how to create my own code like this, which, I’m assuming is passing parameters using a chaining style:
ListDomainsRequest sdbRequest = new ListDomainsRequest().withMaxNumberOfDomains(100);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
as well as the use of the class keyword herein:
AwsConsoleApp.class.getResourceAsStream("AwsCredentials.properties")
^^^^^
What are the proper names for these techniques? Thanks!
I think what you are referring to is the Fluent Interface. A quick wiki snip is…
Here is also a nice blog post by Adewale Oshineye giving some general thoughts on the subject as well.
[update] I just realized you question about class is separate from the first. For that you just need to realize that .class is a way to access the object’s java.lang.Class type which is useful in certain cases.