Class FavoriteUtil


  • public class FavoriteUtil
    extends Object
    Author:
    Ivan Meredith
    • Constructor Detail

      • FavoriteUtil

        public FavoriteUtil()
    • Method Detail

      • toggle

        public static void toggle​(io.jenkins.blueocean.rest.model.BlueFavoriteAction action,
                                  Item item)
      • decodeFullName

        public static String decodeFullName​(String name)
      • getFavorite

        public static io.jenkins.blueocean.rest.model.BlueFavorite getFavorite​(Item item)
      • getFavorite

        public static io.jenkins.blueocean.rest.model.BlueFavorite getFavorite​(Item item,
                                                                               @Nonnull
                                                                               io.jenkins.blueocean.rest.Reachable parent)
        Gets favorite model for given model model First it tries to find favorite model using BlueFavoriteResolver, if none found then it simply gets the mapped blueocean API resource for the given favorite item, creates BlueFavorite and returns.
        Parameters:
        item - favorited model object
        parent - Reachable parent of BlueOcean favorited API resource. It might be null, in that case parent is computed using LinkResolver.resolve(Object)
        Returns:
        resolved favorite object if found otherwise null