public Map < String , Object > toRepresentation ( ) { Map < String , Object > representation = new HashMap <> ( ) ; if ( templated ( ) ) { representation . put ( "href-template" , hrefTemplate ) ; representation . put ( "href-vars" , hrefVars ( ) ) ; } else { representation . put ( "href" , href ) ; } if ( hints != null ) { Map < String , Object > hintsRepresentation = hints . toRepresentation ( ) ; if ( ! hintsRepresentation . isEmpty ( ) ) { representation . put ( "hints" , hintsRepresentation ) ; } } return representation ; }
Serializes the resource into a map .