Class UserTemplate

  • All Implemented Interfaces:
    UserOperations

    public class UserTemplate
    extends Object
    implements UserOperations

    User template implementation.

    Author:
    Willie Wheeler (willie.wheeler@gmail.com)
    • Constructor Detail

      • UserTemplate

        public UserTemplate​(org.springframework.web.client.RestTemplate restTemplate,
                            boolean isAuthorizedForUser)
        Parameters:
        restTemplate - RestTemplate
        isAuthorizedForUser - boolean
    • Method Detail

      • getProfileId

        public String getProfileId()
        Description copied from interface: UserOperations
        Retrieves the user's GitHub profile ID.
        Specified by:
        getProfileId in interface UserOperations
        Returns:
        the user's GitHub profile ID.
      • getProfileUrl

        public String getProfileUrl()
        Description copied from interface: UserOperations
        Retrieve the URL to the user's GitHub profile.
        Specified by:
        getProfileUrl in interface UserOperations
        Returns:
        the URL to the user's GitHub profile.
      • getFollowing

        public List<GitHubUser> getFollowing​(String user)
        Description copied from interface: UserOperations
        Public operation to return the users that a given user is following.
        Specified by:
        getFollowing in interface UserOperations
        Parameters:
        user - GitHub user
        Returns:
        list of users the given user is following
      • requireAuthorization

        protected void requireAuthorization()