public class URLHandlerDTO extends Object implements URLHandler
| Modifier and Type | Field and Description |
|---|---|
protected Long |
id |
protected String |
incomingURL |
protected String |
newURL |
protected String |
urlRedirectType |
| Constructor and Description |
|---|
URLHandlerDTO(String newUrl,
URLRedirectType redirectType) |
| Modifier and Type | Method and Description |
|---|---|
<G extends URLHandler> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
Long |
getId() |
String |
getIncomingURL() |
String |
getNewURL() |
URLRedirectType |
getUrlRedirectType() |
void |
setId(Long id) |
void |
setIncomingURL(String incomingURL) |
void |
setNewURL(String newURL) |
void |
setUrlRedirectType(URLRedirectType redirectType) |
protected Long id
protected String incomingURL
protected String newURL
protected String urlRedirectType
public URLHandlerDTO(String newUrl, URLRedirectType redirectType)
public Long getId()
getId in interface URLHandlerpublic void setId(Long id)
setId in interface URLHandlerpublic String getIncomingURL()
getIncomingURL in interface URLHandlerpublic void setIncomingURL(String incomingURL)
setIncomingURL in interface URLHandlerpublic String getNewURL()
getNewURL in interface URLHandlerpublic void setNewURL(String newURL)
setNewURL in interface URLHandlerpublic URLRedirectType getUrlRedirectType()
getUrlRedirectType in interface URLHandlerpublic void setUrlRedirectType(URLRedirectType redirectType)
setUrlRedirectType in interface URLHandlerpublic <G extends URLHandler> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
MultiTenantCloneable
public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context);
if (createResponse.isAlreadyPopulated()) {
return createResponse;
}
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse createResponse = context.createOrRetrieveCopyInstance(this);
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
createOrRetrieveCopyInstance in interface MultiTenantCloneable<URLHandler>context - a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException - if there's a problem detected with the cloning configurationCopyright © 2017. All rights reserved.