Interface FriendlyEnum
- All Known Subinterfaces:
CacheKeyEnum,CacheSubKeyEnum,ClassMarkerEnum,ClassValueKeyEnum,CommentStatusEnum,PostFormatEnum,PostStatusEnum,PostTypeEnum,QueryParamEnum,RestPathEnum,URLFieldsEnum
- All Known Implementing Classes:
EnvironmentScope,TaxonomyMarker,TaxonomyValues,WPCacheKey,WPCacheSubKey,WPCommentStatus,WPFormat,WPPathField,WPPostType,WPQueryParam,WPRestPath,WPStatus
public sealed interface FriendlyEnum
permits CacheKeyEnum, CacheSubKeyEnum, ClassMarkerEnum, CommentStatusEnum, EnvironmentScope, PostFormatEnum, PostStatusEnum, PostTypeEnum, QueryParamEnum, RestPathEnum, URLFieldsEnum
This interface is designed to enforce a consistent approach to Java enums in the PowerWP4j
project. It provides a uniform way to access the value of enum constants, which is the actual
string to be used in the API. By extending this interface, enums become more user-friendly and
easier to work with. Only top-level enum types provided by PowerWP4j implement this interface to
avoid misuse.
-
Method Summary
-
Method Details
-
value
Returns the value of the enum constant, which is the actual string to be used in the API.Example: If an enum constant is named
STATUS_PENDING, the value returned by this method would be"pending", which is the value provided in its constructor.- Returns:
- the value of the enum constant
-