media/src/main/java/androidx/media/MediaMetadata2.java
public @NonNull Builder putRating(@NonNull @RatingKey String key,
                @Nullable Rating2 value) {
            if (key == null) {
                throw new IllegalArgumentException("key shouldn't be null");
            }
            if (METADATA_KEYS_TYPE.containsKey(key)) {
                if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_RATING) {
                    throw new IllegalArgumentException("The " + key
                            + " key cannot be used to put a Rating");
                }
            }
            mBundle.putBundle(key, (value == null) ? null : value.toBundle());
            return this;
        }
/**
         * Put a {@link Rating2} into the metadata. Custom keys may be used, but
         * if the METADATA_KEYs defined in this class are used they may only be
         * one of the following:
         * <ul>
         * <li>{@link #METADATA_KEY_RATING}</li>
         * <li>{@link #METADATA_KEY_USER_RATING}</li>
         * </ul>
         *
         * @param key The key for referencing this value
         * @param value The String value to store
         * @return The Builder to allow chaining
         */
Put a  Rating2 into the metadata. Custom keys may be used, but
if the METADATA_KEYs defined in this class are used they may only be
one of the following:

 #METADATA_KEY_RATING
 #METADATA_KEY_USER_RATING


@param key The key for referencing this value
@param value The String value to store
@return The Builder to allow chaining
Put a Rating2 into the metadata . Custom keys may be used but if the METADATA_KEYs defined in this class are used they may only be one of the following : #METADATA_KEY_RATING #METADATA_KEY_USER_RATING @param key The key for referencing this value @param value The String value to store @return The Builder to allow chaining
public @NonNull Builder putRating(@NonNull @RatingKey String key,
                @Nullable Rating2 value) {
            if (key == null) {
                throw new IllegalArgumentException("key shouldn't be null");
            }
            if (METADATA_KEYS_TYPE.containsKey(key)) {
                if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_RATING) {
                    throw new IllegalArgumentException("The " + key
                            + " key cannot be used to put a Rating");
                }
            }
            mBundle.putBundle(key, (value == null) ? null : value.toBundle());
            return this;
        }
public @ NonNull Builder putRating ( @ NonNull @ RatingKey String key , @ Nullable Rating2 value ) { if ( key == null ) { throw new IllegalArgumentException ( "key shouldn't be null" ) ; } if ( METADATA_KEYS_TYPE . containsKey ( key ) ) { if ( METADATA_KEYS_TYPE . get ( key ) != METADATA_TYPE_RATING ) { throw new IllegalArgumentException ( "The " + key + " key cannot be used to put a Rating" ) ; } } mBundle . putBundle ( key , ( value == null ) ? null : value . toBundle ( ) ) ; return this ; }
Put a {@link Rating2} into the metadata.
Put a { @link Rating2 } into the metadata .