- All Implemented Interfaces:
Serializable
,Comparable<TopLevelType>
,Constable
,org.refcodes.mixin.NameAccessor
The
TopLevelType
is the top-level part of a HTTP Media-Type. See
MediaType
for a full list of the so called HTTP Media-Types. Given
the HTTP Media-Type "application/json", "application" is considered to be the
top-level Media-Type and "json" to be the Sub-Media-Type. As of common
speaking, the Sub-Media-Type is usually called Media-Type. Therefore the
Sub-Media-Types are gathered in the MediaType
enumeration to avoid
misunderstanding.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface org.refcodes.mixin.NameAccessor
org.refcodes.mixin.NameAccessor.NameBuilder<B extends org.refcodes.mixin.NameAccessor.NameBuilder<B>>, org.refcodes.mixin.NameAccessor.NameMutator, org.refcodes.mixin.NameAccessor.NameProperty
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TopLevelType
fromHttpTopLevelType
(String aHttpTopLevelType) Returns thatTopLevelType
represented by the given HTTP Top-Level-Media-Type.getName()
Gets the name.static TopLevelType
Returns the enum constant of this class with the specified name.static TopLevelType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WILDCARD
-
NONE
-
UNKNOWN
-
APPLICATION
-
AUDIO
-
IMAGE
-
MESSAGE
-
MODEL
-
TEXT
-
MULTIPART
-
VIDEO
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
Gets the name.- Specified by:
getName
in interfaceorg.refcodes.mixin.NameAccessor
- Returns:
- the name
-
fromHttpTopLevelType
Returns thatTopLevelType
represented by the given HTTP Top-Level-Media-Type. If the HTTP Media-Type contains the Media-Sub-Type portion (in terms ofMediaType
), then the provided HTTP Media-Type till the "/" slash is evaluated. For example "application/json" as well as "application" will returnAPPLICATION
.- Parameters:
aHttpTopLevelType
- The HTTP Media-Type for which to determine theTopLevelType
.- Returns:
- The determined
TopLevelType
or null if none was determinable.
-