Class AvatarMetadataAction

    • Constructor Detail

      • AvatarMetadataAction

        public AvatarMetadataAction()
    • Method Detail

      • getAvatarDescription

        @CheckForNull
        public String getAvatarDescription()
        Returns the description to use for the tool tip of the avatar of this object.
        Returns:
        the avatar description or null
        Throws:
        IllegalStateException - if called outside of a request handling thread.
      • getAvatarImageOf

        @CheckForNull
        public String getAvatarImageOf​(@NonNull
                                       String size)
        Returns the URL of the avatar of this object in the requested size or null if there is no avatar for this object. Ideally only getAvatarIconClassName() would be used, but to allow for the case where the avatar is hosted on an external server this method can be used to retrieve the avatar image.
        Parameters:
        size - the size, the following sizes must be supported: 16x16, 24x24, 32x32 and 48x48.
        Returns:
        the url or null
        Throws:
        IllegalStateException - if called outside of a request handling thread.
      • avatarIconClassNameImageOf

        @CheckForNull
        protected final String avatarIconClassNameImageOf​(@CheckForNull
                                                          String iconClassName,
                                                          @NonNull
                                                          String size)
        Helper method to resolve the icon image url.
        Parameters:
        iconClassName - the icon class name.
        size - the size string, e.g. 16x16, 24x24, etc.
        Returns:
        the icon image url or null
        Throws:
        IllegalStateException - if called outside of a request handling thread.
      • cachedResizedImageOf

        @NonNull
        protected final String cachedResizedImageOf​(@NonNull
                                                    String url,
                                                    @NonNull
                                                    String size)
        Helper method to resolve an external image, cache it and resize it to the specified size. If the external URL cannot be retrieved by Jenkins, then a randomly generated avatar will be generated using the external URL as a seed (so that the generated avatar image for any given external URL will be consistent across both Jenkins instances and restarts).
        Parameters:
        url - the URL of the image to cache.
        size - the size string, e.g. 16x16, 24x24, etc.
        Returns:
        the icon image url.
        Throws:
        IllegalStateException - if called outside of a request handling thread.
        Since:
        2.2.0
      • equals

        public abstract boolean equals​(Object o)
        Overrides:
        equals in class Object
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class Object