Interface HasDisplayName
- All Superinterfaces:
HasName
HasDisplayName -- The object has a name to display in UIs.
The display name can be combined but should not exceed 100 characters.
The method
limitTo100Characters(String)
can be used for implementations to cut of too long display names.- Since:
- 0.1.0 2021-04-18
- Version:
- 2.0.2 2022-01-16
- Author:
- klenkes74 <rlichti@kaiserpfalz-edv.de>
-
Field Summary
Fields inherited from interface de.kaiserpfalzedv.commons.api.resources.HasName
VALID_NAME_EXAMPLE, VALID_NAME_LENGTH_MSG, VALID_NAME_MAX_LENGTH, VALID_NAME_MIN_LENGTH, VALID_NAME_PATTERN, VALID_NAME_PATTERN_MSG
-
Method Summary
Modifier and TypeMethodDescriptiondefault @Size(min=3,max=100,message="The length of the string must be between 3 and 100 characters long.") @Pattern(regexp="^[a-zA-Z][-a-zA-Z0-9]{1,61}(.[a-zA-Z][-a-zA-Z0-9]{1,61}){0,4}$",message="The string must match the pattern \'^[a-zA-Z][-a-zA-Z0-9]{1,61}(.[a-zA-Z][-a-zA-Z0-9]{1,61}){0,4}$\'") String
Default implementation of getDisplayName().default String
limitTo100Characters
(String content) Limits the length of the content to 100 by taking at most 97 characters length of the content and then adding 3 dots.
-
Method Details
-
getDisplayName
@Size(min=3, max=100, message="The length of the string must be between 3 and 100 characters long.") @Pattern(regexp="^[a-zA-Z][-a-zA-Z0-9]{1,61}(.[a-zA-Z][-a-zA-Z0-9]{1,61}){0,4}$", message="The string must match the pattern \'^[a-zA-Z][-a-zA-Z0-9]{1,61}(.[a-zA-Z][-a-zA-Z0-9]{1,61}){0,4}$\'") default @Size(min=3,max=100,message="The length of the string must be between 3 and 100 characters long.") @Pattern(regexp="^[a-zA-Z][-a-zA-Z0-9]{1,61}(.[a-zA-Z][-a-zA-Z0-9]{1,61}){0,4}$",message="The string must match the pattern \'^[a-zA-Z][-a-zA-Z0-9]{1,61}(.[a-zA-Z][-a-zA-Z0-9]{1,61}){0,4}$\'") String getDisplayName()Default implementation of getDisplayName().- Returns:
- the result of
HasName.getName()
.
-
limitTo100Characters
Limits the length of the content to 100 by taking at most 97 characters length of the content and then adding 3 dots.- Parameters:
content
- the content to be cut off.- Returns:
- the cut of content.
-