public class URLHandlerDTO extends Object implements URLHandler
| Modifier and Type | Field and Description |
|---|---|
protected Long |
id |
protected String |
incomingURL |
protected boolean |
isRegex |
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() |
boolean |
isRegexHandler()
Indicates if the value returned by
getIncomingURL() is a regex expression
rather than a concrete URI. |
void |
setId(Long id) |
void |
setIncomingURL(String incomingURL) |
void |
setNewURL(String newURL) |
void |
setRegexHandler(boolean regexHandler)
Deprecated.
|
void |
setRegexHandler(Boolean regexHandler)
Indicates if the value set by the method
setIncomingURL(String) should be treated as a regex
expression rather than as a concrete URI. |
void |
setUrlRedirectType(URLRedirectType redirectType) |
protected Long id
protected String incomingURL
protected String newURL
protected String urlRedirectType
protected boolean isRegex
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 boolean isRegexHandler()
URLHandlergetIncomingURL() is a regex expression
rather than a concrete URI. Default is false.isRegexHandler in interface URLHandler@Deprecated public void setRegexHandler(boolean regexHandler)
setRegexHandler in interface URLHandlerpublic void setRegexHandler(Boolean regexHandler)
URLHandlersetIncomingURL(String) should be treated as a regex
expression rather than as a concrete URI.setRegexHandler 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 © 2022. All rights reserved.