File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
src/main/java/org/springframework/hateoas Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,16 @@ public Link withAffordances(List<Affordance> affordances) {
251
251
this .profile , this .name , this .template , affordances );
252
252
}
253
253
254
+ /**
255
+ * Returns a new {@link Link} without any {@link Affordance}s.
256
+ *
257
+ * @return will never be {@literal null}.
258
+ * @since 3.0
259
+ */
260
+ public Link withoutAffordances () {
261
+ return withAffordances (Collections .emptyList ());
262
+ }
263
+
254
264
/**
255
265
* Returns the variable names contained in the template.
256
266
*
@@ -289,13 +299,26 @@ public boolean isTemplated() {
289
299
return template == null ? false : !template .getVariables ().isEmpty ();
290
300
}
291
301
302
+ /**
303
+ * Returns whether the links are logically the same, i.e. share all link characteristics but might have different
304
+ * affordances attached.
305
+ *
306
+ * @param other must not be {@literal null}.
307
+ * @since 3.0
308
+ */
309
+ public boolean isSameAs (Link other ) {
310
+
311
+ Assert .notNull (other , "Link must not be null!" );
312
+
313
+ return withoutAffordances ().equals (other .withoutAffordances ());
314
+ }
315
+
292
316
/**
293
317
* Turns the current template into a {@link Link} by expanding it using the given parameters.
294
318
*
295
319
* @param arguments
296
320
* @return
297
321
*/
298
- @ SuppressWarnings ("null" )
299
322
public Link expand (Object ... arguments ) {
300
323
301
324
UriTemplate template = this .template ;
You can’t perform that action at this time.
0 commit comments