Package dev.enola.common.protobuf
Class ProtobufMediaTypes
java.lang.Object
dev.enola.common.protobuf.ProtobufMediaTypes
- All Implemented Interfaces:
MediaTypeProvider,ResourceMediaTypeDetector
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMediaType parameter to indicate the resource's root message fully qualified name.static final MediaTypestatic final MediaTypestatic final MediaType"ProtoBuf as JSON" - which is different from e.g.static final MediaTypestatic final MediaType"ProtoBuf as YAML" - which is different from e.g. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMaps the URI path "extension" (WITH the dot; or not, filenames such as "README" are also permitted!) to its "canonical" Media Types.getProtoMessageFQN(MediaType mediaType) Maps "canonical" (primary) Media Types to a set of its "also known as alternatives".static MediaTypesetProtoMessageFQN(MediaType mediaType, String protoFQN) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.enola.common.io.mediatype.MediaTypeProvider
detectMethods inherited from interface dev.enola.common.io.mediatype.ResourceMediaTypeDetector
detect
-
Field Details
-
PARAMETER_PROTO_MESSAGE
MediaType parameter to indicate the resource's root message fully qualified name. Inspired by https://protobuf.dev/reference/protobuf/textformat-spec/#header.- See Also:
-
PROTO_UTF_8
-
PROTOBUF_TEXTPROTO_UTF_8
-
PROTOBUF_JSON_UTF_8
"ProtoBuf as JSON" - which is different from e.g. a JSON-LD representation of RDF. -
PROTOBUF_YAML_UTF_8
"ProtoBuf as YAML" - which is different from e.g. a YAML-LD representation of RDF. -
PROTOBUF_BINARY
-
-
Constructor Details
-
ProtobufMediaTypes
public ProtobufMediaTypes()
-
-
Method Details
-
setProtoMessageFQN
-
getProtoMessageFQN
-
knownTypesWithAlternatives
Description copied from interface:MediaTypeProviderMaps "canonical" (primary) Media Types to a set of its "also known as alternatives".- Specified by:
knownTypesWithAlternativesin interfaceMediaTypeProvider
-
extensionsToTypes
Description copied from interface:MediaTypeProviderMaps the URI path "extension" (WITH the dot; or not, filenames such as "README" are also permitted!) to its "canonical" Media Types. This should only be used for "informational" listing kind of output. To actually determine a MediaType, please useMediaTypeProvider.detect(String, ByteSource, MediaType)instead.- Specified by:
extensionsToTypesin interfaceMediaTypeProvider
-