View Javadoc

1   package com.atlassian.marketplace.client.model;
2   
3   import java.net.URI;
4   
5   import com.atlassian.fugue.Option;
6   import com.atlassian.marketplace.client.api.VendorId;
7   
8   /**
9    * Properties that exist in both {@link Vendor} and {@link VendorSummary}.
10   * @since 2.0.0
11   */
12  public abstract class VendorBase implements Entity
13  {
14      Links _links;
15      String name;
16      @ReadOnly Option<String> verifiedStatus;
17      @RequiredLink(rel = "self") URI selfUri;
18      @RequiredLink(rel = "alternate") URI alternateUri;
19      
20      @Override
21      public Links getLinks()
22      {
23          return _links;
24      }
25  
26      /**
27       * The unique resource identifier for the vendor.
28       * @see AddonBase#getVendorId()
29       * @see ModelBuilders.AddonBuilder#vendor(VendorId)
30       * @see com.atlassian.marketplace.client.api.Vendors#getById(VendorId)
31       */
32      public VendorId getId()
33      {
34          return VendorId.fromUri(selfUri);
35      }
36      
37      @Override
38      public URI getSelfUri()
39      {
40          return selfUri;
41      }
42      
43      /**
44       * The address of a Marketplace page that shows details of the vendor.
45       */
46      public URI getAlternateUri()
47      {
48          return alternateUri;
49      }
50      
51      /**
52       * The vendor name.
53       */
54      public String getName()
55      {
56          return name;
57      }
58      
59      /**
60       * The vendor logo.
61       */
62      public abstract Option<ImageInfo> getLogo();
63  
64      /**
65       * True if the vendor has Atlassian Verified status.
66       */
67      public boolean isVerified()
68      {
69          return "verified".equalsIgnoreCase(verifiedStatus.getOrElse(""));
70      }
71  }