public class MockLicenseDetailsFactory extends Object implements LicenseDetailsFactory
Constructor and Description |
---|
MockLicenseDetailsFactory() |
Modifier and Type | Method and Description |
---|---|
MockLicenseDetails |
addLicense(String license) |
MockLicenseDetailsFactory |
byDefaultReturnLicense() |
MockLicenseDetailsFactory |
byDefaultThrowError() |
LicenseDetails |
getLicense(String licenseString)
Converts an encoded license key into a
LicenseDetails . |
boolean |
isDecodeable(String licenseString)
Determines whether a license string can be decoded by this factory.
|
@Nonnull public LicenseDetails getLicense(@Nonnull String licenseString) throws com.atlassian.extras.api.LicenseException
LicenseDetailsFactory
LicenseDetails
. This method never
returns null, if the provided license key is undecodable or not for a JIRA Product a LicenseException
is thrown.getLicense
in interface LicenseDetailsFactory
licenseString
- the encoded license key.com.atlassian.extras.api.LicenseException
- if licenseString was null or could not be decoded (see LicenseDetailsFactory.isDecodeable(String)
.public boolean isDecodeable(@Nonnull String licenseString)
LicenseDetailsFactory
isDecodeable
in interface LicenseDetailsFactory
licenseString
- the (usually encrypted) license string to testpublic MockLicenseDetailsFactory byDefaultReturnLicense()
public MockLicenseDetailsFactory byDefaultThrowError()
public MockLicenseDetails addLicense(String license)
Copyright © 2002-2019 Atlassian. All Rights Reserved.