Package no.fintlabs.adapter.models.utils
Class LinkUtilities
- java.lang.Object
-
- no.fintlabs.adapter.models.utils.LinkUtilities
-
public class LinkUtilities extends java.lang.Object
Utility methods for working withFintLinks
resources.These methods help extract the self link identifiers (e.g. systemId values) from a FINT resource. The returned value is now only the final identifier segment, not the full link URL.
-
-
Constructor Summary
Constructors Constructor Description LinkUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getSelfLinkBy(java.lang.String identifier, no.fint.model.resource.FintLinks resource)
Retrieves the identifier value from aFintLinks
resource based on a specific identifier name.static java.lang.String
getSelfLinkBySystemId(no.fint.model.resource.FintLinks resource)
Retrieves the identifier value from aFintLinks
resource using the default identifier namesystemid
.
-
-
-
Method Detail
-
getSelfLinkBy
public static java.lang.String getSelfLinkBy(java.lang.String identifier, no.fint.model.resource.FintLinks resource)
Retrieves the identifier value from aFintLinks
resource based on a specific identifier name.For example, if a self link is:
https://api.fintlabs.no/administrasjon/personalressurs/systemid/abc123
this method will return:abc123
For more details, see
SyncPageEntry.ofIdentifierName()
.- Parameters:
identifier
- The name of the identifier in the URL path (e.g. "systemid").resource
- TheFintLinks
resource.- Returns:
- The raw identifier value (the last path segment of the self link).
- Throws:
java.lang.IllegalArgumentException
- if no self link is found for the given identifier.
-
getSelfLinkBySystemId
public static java.lang.String getSelfLinkBySystemId(no.fint.model.resource.FintLinks resource)
Retrieves the identifier value from aFintLinks
resource using the default identifier namesystemid
.This is equivalent to calling:
getSelfLinkBy("systemid", resource);
- Parameters:
resource
- TheFintLinks
resource.- Returns:
- The raw systemId value.
-
-