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.LicenseTypeId;
7
8 /**
9 * Information about a type of software license.
10 * @since 2.0.0
11 */
12 public final class LicenseType implements Entity
13 {
14 Links _links;
15 String key;
16 String name;
17
18 @RequiredLink(rel = "self") URI selfUri;
19
20 @Override
21 public Links getLinks()
22 {
23 return _links;
24 }
25
26 @Override
27 public URI getSelfUri()
28 {
29 return selfUri;
30 }
31
32 /**
33 * The unique resource identifier for the license type.
34 * @see AddonVersionBase#getLicenseTypeId()
35 * @see ModelBuilders.AddonVersionBuilder#licenseTypeId(Option)
36 */
37 public LicenseTypeId getId()
38 {
39 return LicenseTypeId.fromUri(selfUri);
40 }
41
42 /**
43 * Address of a web page that describes the license type.
44 */
45 public Option<URI> getAlternateUri()
46 {
47 return _links.getUri("alternate");
48 }
49
50 /**
51 * A short string identifier that Marketplace uses to describe this license type, such as "gpl".
52 * @see com.atlassian.marketplace.client.api.LicenseTypes#getByKey(String)
53 */
54 public String getKey()
55 {
56 return key;
57 }
58
59 /**
60 * The name of the license type, such as "GNU Public License (GPL)".
61 */
62 public String getName()
63 {
64 return name;
65 }
66 }