media/src/main/java/androidx/media/DataSourceDesc.java
public @NonNull DataSourceDesc build() {
            if (mType != TYPE_CALLBACK
                    && mType != TYPE_FD
                    && mType != TYPE_URI) {
                throw new IllegalStateException("Illegal type: " + mType);
            }
            if (mStartPositionMs > mEndPositionMs) {
                throw new IllegalStateException("Illegal start/end position: "
                        + mStartPositionMs + " : " + mEndPositionMs);
            }

            DataSourceDesc dsd = new DataSourceDesc();
            dsd.mType = mType;
            dsd.mMedia2DataSource = mMedia2DataSource;
            dsd.mFD = mFD;
            dsd.mFDOffset = mFDOffset;
            dsd.mFDLength = mFDLength;
            dsd.mUri = mUri;
            dsd.mUriHeader = mUriHeader;
            dsd.mUriCookies = mUriCookies;
            dsd.mUriContext = mUriContext;

            dsd.mMediaId = mMediaId;
            dsd.mStartPositionMs = mStartPositionMs;
            dsd.mEndPositionMs = mEndPositionMs;

            return dsd;
        }
/**
         * Combines all of the fields that have been set and return a new
         * {@link DataSourceDesc} object. <code>IllegalStateException</code> will be
         * thrown if there is conflict between fields.
         *
         * @return a new {@link DataSourceDesc} object
         */
Combines all of the fields that have been set and return a new
DataSourceDesc object. IllegalStateException will be
thrown if there is conflict between fields.

@return a new  DataSourceDesc object
Combines all of the fields that have been set and return a new DataSourceDesc object . IllegalStateException will be thrown if there is conflict between fields . @return a new DataSourceDesc object
public @NonNull DataSourceDesc build() {
            if (mType != TYPE_CALLBACK
                    && mType != TYPE_FD
                    && mType != TYPE_URI) {
                throw new IllegalStateException("Illegal type: " + mType);
            }
            if (mStartPositionMs > mEndPositionMs) {
                throw new IllegalStateException("Illegal start/end position: "
                        + mStartPositionMs + " : " + mEndPositionMs);
            }
            DataSourceDesc dsd = new DataSourceDesc();
            dsd.mType = mType;
            dsd.mMedia2DataSource = mMedia2DataSource;
            dsd.mFD = mFD;
            dsd.mFDOffset = mFDOffset;
            dsd.mFDLength = mFDLength;
            dsd.mUri = mUri;
            dsd.mUriHeader = mUriHeader;
            dsd.mUriCookies = mUriCookies;
            dsd.mUriContext = mUriContext;
            dsd.mMediaId = mMediaId;
            dsd.mStartPositionMs = mStartPositionMs;
            dsd.mEndPositionMs = mEndPositionMs;
            return dsd;
        }
public @ NonNull DataSourceDesc build ( ) { if ( mType != TYPE_CALLBACK && mType != TYPE_FD && mType != TYPE_URI ) { throw new IllegalStateException ( "Illegal type: " + mType ) ; } if ( mStartPositionMs > mEndPositionMs ) { throw new IllegalStateException ( "Illegal start/end position: " + mStartPositionMs + " : " + mEndPositionMs ) ; } DataSourceDesc dsd = new DataSourceDesc ( ) ; dsd . mType = mType ; dsd . mMedia2DataSource = mMedia2DataSource ; dsd . mFD = mFD ; dsd . mFDOffset = mFDOffset ; dsd . mFDLength = mFDLength ; dsd . mUri = mUri ; dsd . mUriHeader = mUriHeader ; dsd . mUriCookies = mUriCookies ; dsd . mUriContext = mUriContext ; dsd . mMediaId = mMediaId ; dsd . mStartPositionMs = mStartPositionMs ; dsd . mEndPositionMs = mEndPositionMs ; return dsd ; }
Combines all of the fields that have been set and return a new
 {@link DataSourceDesc} object.
Combines all of the fields that have been set and return a new { @link DataSourceDesc } object .