private static void validate ( RepresentationModel < ? > resource , HalFormsAffordanceModel model ) { String affordanceUri = model . getURI ( ) ; String selfLinkUri = resource . getRequiredLink ( IanaLinkRelations . SELF . value ( ) ) . expand ( ) . getHref ( ) ; if ( ! affordanceUri . equals ( selfLinkUri ) ) { throw new IllegalStateException ( "Affordance's URI " + affordanceUri + " doesn't match self link " + selfLinkUri + " as expected in HAL-FORMS" ) ; } }
Verify that the resource s self link and the affordance s URI have the same relative path .