public static EnhancedMimeType mimeType ( @ NotNull final SerializerRegistry registry , @ NotNull final List < CommonEvent > commonEvents ) { Contract . requireArgNotNull ( "registry" , registry ) ; Contract . requireArgNotNull ( "commonEvents" , commonEvents ) ; EnhancedMimeType mimeType = null ; for ( final CommonEvent commonEvent : commonEvents ) { final Serializer serializer = registry . getSerializer ( new SerializedDataType ( commonEvent . getDataType ( ) . asBaseType ( ) ) ) ; if ( mimeType == null ) { mimeType = serializer . getMimeType ( ) ; } else { if ( ! mimeType . equals ( serializer . getMimeType ( ) ) ) { return null ; } } } return mimeType ; }
Returns the mime types shared by all events in the list .