Class LinkUtilities


  • public class LinkUtilities
    extends java.lang.Object
    Utility methods for working with FintLinks 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 a FintLinks resource based on a specific identifier name.
      static java.lang.String getSelfLinkBySystemId​(no.fint.model.resource.FintLinks resource)
      Retrieves the identifier value from a FintLinks resource using the default identifier name systemid.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LinkUtilities

        public LinkUtilities()
    • Method Detail

      • getSelfLinkBy

        public static java.lang.String getSelfLinkBy​(java.lang.String identifier,
                                                     no.fint.model.resource.FintLinks resource)
        Retrieves the identifier value from a FintLinks 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 - The FintLinks 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 a FintLinks resource using the default identifier name systemid.

        This is equivalent to calling:

         getSelfLinkBy("systemid", resource);
         

        Parameters:
        resource - The FintLinks resource.
        Returns:
        The raw systemId value.