public class ApplicationEntityTranslator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ApplicationEntityTranslator.PasswordMode |
Modifier and Type | Method and Description |
---|---|
static Boolean |
getBoolean(Boolean b)
Returns the boolean if not null, otherwise returns false.
|
static ApplicationEntityList |
toApplicationEntities(Collection<Application> applications,
URI baseUri)
Translates from a collection of
Application s to a list of ApplicationEntity s. |
static ApplicationEntity |
toApplicationEntity(Application application,
com.atlassian.plugins.rest.common.Link link)
Translates from an Application to an ApplicationEntity.
|
static ApplicationEntity |
toApplicationEntity(Application application,
com.atlassian.plugins.rest.common.Link link,
ApplicationEntityTranslator.PasswordMode passwordMode)
Translates from an Application to an ApplicationEntity.
|
static ApplicationType |
toApplicationType(String type)
Translates from an application type string to an
ApplicationType . |
static Application |
toApplicationWithNoDirectoryMappings(ApplicationEntity applicationEntity)
Translates from an ApplicationEntity to an Application with no directory mappings.
|
static AttributeEntityList |
toAttributeEntities(Map<String,String> attributes)
Translates attributes to
AttributeEntityList . |
static DirectoryMapping |
toDirectoryMapping(DirectoryMappingEntity directoryMappingEntity,
Application application,
Directory directory)
Translates from a
DirectoryMappingEntity to a DirectoryMapping . |
static DirectoryMappingEntityList |
toDirectoryMappingEntities(List<DirectoryMapping> directoryMappings,
URI applicationUri)
Translates from a list of
DirectoryMapping to a DirectoryMappingEntityList . |
static DirectoryMappingEntity |
toDirectoryMappingEntity(DirectoryMapping directoryMapping,
URI directoryMappingsUri)
Translates from a
DirectoryMapping to a DirectoryMappingEntity . |
static List<DirectoryMapping> |
toDirectoryMappings(DirectoryMappingEntityList directoryMappingEntities,
Application application,
DirectoryManager directoryManager)
Translates from a
DirectoryMappingEntityList to a list of DirectoryMapping . |
static OperationType |
toOperationType(String type)
Translates from an operation type string to an
OperationType . |
static Set<OperationType> |
toOperationTypes(Set<String> types)
Translates from a set of operation type strings to a set of
OperationType . |
static String |
toOperationTypeString(OperationType type)
Translates from an
OperationType to an operation type string. |
static Set<String> |
toOperationTypeStrings(Set<OperationType> types)
Translates from a set of
OperationType s to a set of operation type strings. |
static PasswordCredential |
toPasswordCredential(PasswordEntity passwordEntity)
Translates from a
PasswordEntity to a PasswordCredential . |
static RemoteAddress |
toRemoteAddress(RemoteAddressEntity remoteAddressEntity)
Translates from a
RemoteAddressEntity to a RemoteAddress . |
static RemoteAddressEntitySet |
toRemoteAddressEntities(Set<RemoteAddress> remoteAddresses,
URI baseUri)
Translate from a set of
RemoteAddress es to RemoteAddressEntitySet . |
static RemoteAddressEntity |
toRemoteAddressEntity(RemoteAddress remoteAddress,
URI baseUri)
Translate from a
RemoteAddress to a RemoteAddressEntity . |
static Set<RemoteAddress> |
toRemoteAddresses(RemoteAddressEntitySet remoteAddressEntities)
Translates from a
RemoteAddressEntitySet to a set of RemoteAddress . |
public static Application toApplicationWithNoDirectoryMappings(ApplicationEntity applicationEntity)
applicationEntity
- ApplicationEntity to convertpublic static ApplicationEntity toApplicationEntity(Application application, com.atlassian.plugins.rest.common.Link link)
application
- Application to convertlink
- Link to the Applicationpublic static ApplicationEntity toApplicationEntity(Application application, com.atlassian.plugins.rest.common.Link link, ApplicationEntityTranslator.PasswordMode passwordMode)
application
- Application to convertlink
- Link to the ApplicationpasswordMode
- whether to include the password in the application entitypublic static PasswordCredential toPasswordCredential(PasswordEntity passwordEntity)
PasswordEntity
to a PasswordCredential
.passwordEntity
- password entity to translatepublic static List<DirectoryMapping> toDirectoryMappings(DirectoryMappingEntityList directoryMappingEntities, Application application, DirectoryManager directoryManager) throws DirectoryNotFoundException
DirectoryMappingEntityList
to a list of DirectoryMapping
.directoryMappingEntities
- list of directory mapping entitiesapplication
- the application being mappeddirectoryManager
- the DirectoryManagerDirectoryNotFoundException
- if the directory being mapped could not be foundpublic static DirectoryMapping toDirectoryMapping(DirectoryMappingEntity directoryMappingEntity, Application application, Directory directory)
DirectoryMappingEntity
to a DirectoryMapping
.directoryMappingEntity
- directory mapping entityapplication
- the application to mapdirectory
- the directory to mappublic static DirectoryMappingEntityList toDirectoryMappingEntities(List<DirectoryMapping> directoryMappings, URI applicationUri)
DirectoryMapping
to a DirectoryMappingEntityList
.directoryMappings
- list of directory mappingsapplicationUri
- URI for the application resourcepublic static DirectoryMappingEntity toDirectoryMappingEntity(DirectoryMapping directoryMapping, URI directoryMappingsUri)
DirectoryMapping
to a DirectoryMappingEntity
.directoryMapping
- directory mappingdirectoryMappingsUri
- URI to the application directory mappings resourcepublic static Set<RemoteAddress> toRemoteAddresses(RemoteAddressEntitySet remoteAddressEntities)
RemoteAddressEntitySet
to a set of RemoteAddress
.remoteAddressEntities
- set of remote address entitiespublic static ApplicationEntityList toApplicationEntities(Collection<Application> applications, URI baseUri)
Application
s to a list of ApplicationEntity
s.applications
- collection of applications to translatebaseUri
- base URI of the REST servicepublic static RemoteAddress toRemoteAddress(RemoteAddressEntity remoteAddressEntity)
RemoteAddressEntity
to a RemoteAddress
.remoteAddressEntity
- remote address entitypublic static RemoteAddressEntitySet toRemoteAddressEntities(Set<RemoteAddress> remoteAddresses, URI baseUri)
RemoteAddress
es to RemoteAddressEntitySet
.remoteAddresses
- Remote addressesbaseUri
- base URI of the applicationpublic static RemoteAddressEntity toRemoteAddressEntity(RemoteAddress remoteAddress, URI baseUri)
RemoteAddress
to a RemoteAddressEntity
.remoteAddress
- Remote addressbaseUri
- base URI of the application remote addressespublic static Set<OperationType> toOperationTypes(Set<String> types)
OperationType
.types
- operation types in stringpublic static OperationType toOperationType(String type)
OperationType
.type
- operation type in stringpublic static Set<String> toOperationTypeStrings(Set<OperationType> types)
OperationType
s to a set of operation type strings.types
- a set of OperationTypespublic static String toOperationTypeString(OperationType type)
OperationType
to an operation type string.type
- OperationTypepublic static ApplicationType toApplicationType(String type)
ApplicationType
.type
- application type in stringpublic static AttributeEntityList toAttributeEntities(Map<String,String> attributes)
AttributeEntityList
.attributes
- Attributes of an entityCopyright © 2016 Atlassian. All rights reserved.