@@ -12,6 +12,22 @@ The most straightforward way to navigate between endpoints is using hard-coded r
1212 // Results in: http://example.com/api/contacts
1313 ```
1414
15+ === "Java"
16+
17+ ```java
18+ EntryEndpoint client = new EntryEndpoint(URI.create("http://example.com/api/"));
19+ CollectionEndpoint<Contact> contacts = new CollectionEndpoint<>(client, "contacts", Contact.class);
20+ // Results in: http://example.com/api/contacts
21+ ```
22+
23+ === "Kotlin"
24+
25+ ```kotlin
26+ val client = EntryEndpoint(URI.create("http://example.com/api/"))
27+ val contacts = CollectionEndpoint(client, "contacts", Contact::class.java)
28+ // Results in: http://example.com/api/contacts
29+ ```
30+
1531=== "TypeScript"
1632
1733 ```typescript
@@ -45,6 +61,36 @@ This is often not the desired behavior. TypedRest provides a non-standard `./` p
4561 // child2.Uri = http://example.com/endpoint/subresource
4662 ```
4763
64+ === "Java"
65+
66+ ```java
67+ ElementEndpoint<MyEntity> parent = new ElementEndpoint<>(client, "endpoint", MyEntity.class);
68+ // parent.getUri() = http://example.com/endpoint
69+
70+ // Without ./ prefix - replaces last segment
71+ ActionEndpoint child1 = new ActionEndpoint(parent, "subresource");
72+ // child1.getUri() = http://example.com/subresource
73+
74+ // With ./ prefix - appends to path
75+ ActionEndpoint child2 = new ActionEndpoint(parent, "./subresource");
76+ // child2.getUri() = http://example.com/endpoint/subresource
77+ ```
78+
79+ === "Kotlin"
80+
81+ ```kotlin
82+ val parent = ElementEndpoint(client, "endpoint", MyEntity::class.java)
83+ // parent.uri = http://example.com/endpoint
84+
85+ // Without ./ prefix - replaces last segment
86+ val child1 = ActionEndpoint(parent, "subresource")
87+ // child1.uri = http://example.com/subresource
88+
89+ // With ./ prefix - appends to path
90+ val child2 = ActionEndpoint(parent, "./subresource")
91+ // child2.uri = http://example.com/endpoint/subresource
92+ ```
93+
4894=== "TypeScript"
4995
5096 ```typescript
@@ -79,6 +125,27 @@ You can also register default links that will be used when the server doesn't pr
79125 }
80126 ```
81127
128+ === "Java"
129+
130+ ```java
131+ class MyEndpoint extends AbstractEndpoint {
132+ public MyEndpoint(Endpoint referrer, String relativeUri) {
133+ super(referrer, relativeUri);
134+ setDefaultLink("related", "./related-resource");
135+ }
136+ }
137+ ```
138+
139+ === "Kotlin"
140+
141+ ```kotlin
142+ class MyEndpoint(referrer: Endpoint, relativeUri: String) : AbstractEndpoint(referrer, relativeUri) {
143+ init {
144+ setDefaultLink("related", "./related-resource")
145+ }
146+ }
147+ ```
148+
82149=== "TypeScript"
83150
84151 ```typescript
0 commit comments