@Entity public class URLHandlerImpl extends Object implements URLHandler, Locatable, AdminMainEntity, ProfileEntity, URLHandlerAdminPresentation
URLHandlerAdminPresentation.GroupName, URLHandlerAdminPresentation.GroupOrder, URLHandlerAdminPresentation.TabName, URLHandlerAdminPresentation.TabOrder
Modifier and Type | Field and Description |
---|---|
protected Long |
id |
protected String |
incomingURL |
protected Boolean |
isRegex |
protected String |
newURL |
protected String |
urlRedirectType |
MAIN_ENTITY_NAME_PROPERTY
Constructor and Description |
---|
URLHandlerImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends URLHandler> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
Long |
getId() |
String |
getIncomingURL() |
String |
getLocation()
If this is returning something that is non-null, this MUST return a String that starts with a slash
and does not end with a slash.
|
String |
getMainEntityName() |
String |
getNewURL() |
URLRedirectType |
getUrlRedirectType() |
int |
hashCode() |
protected boolean |
hasRegExCharacters(String location)
In a preview environment,
getLocation() attempts to navigate to the
provided URL. |
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 Long getId()
getId
in interface URLHandler
public void setId(Long id)
setId
in interface URLHandler
public String getIncomingURL()
getIncomingURL
in interface URLHandler
public void setIncomingURL(String incomingURL)
setIncomingURL
in interface URLHandler
public String getNewURL()
getNewURL
in interface URLHandler
public void setNewURL(String newURL)
setNewURL
in interface URLHandler
public URLRedirectType getUrlRedirectType()
getUrlRedirectType
in interface URLHandler
public void setUrlRedirectType(URLRedirectType redirectType)
setUrlRedirectType
in interface URLHandler
public boolean isRegexHandler()
URLHandler
getIncomingURL()
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 URLHandler
public void setRegexHandler(Boolean regexHandler)
URLHandler
setIncomingURL(String)
should be treated as a regex
expression rather than as a concrete URI.setRegexHandler
in interface URLHandler
public String getMainEntityName()
getMainEntityName
in interface AdminMainEntity
public String getLocation()
Locatable
getLocation
in interface Locatable
protected boolean hasRegExCharacters(String location)
getLocation()
attempts to navigate to the
provided URL. If the URL contains a Regular Expression, then we can't
navigate to it.location
- public <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.