Class MediaItem.Builder

  • All Implemented Interfaces:
    MediaItemOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    MediaItem

    public static final class MediaItem.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
    implements MediaItemOrBuilder
     Representation of a media item (such as a photo or video) in Google Photos.
     
    Protobuf type google.photos.types.MediaItem
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • clear

        public MediaItem.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • getDefaultInstanceForType

        public MediaItem getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public MediaItem build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public MediaItem buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public MediaItem.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • setField

        public MediaItem.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                          java.lang.Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • clearField

        public MediaItem.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • clearOneof

        public MediaItem.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • setRepeatedField

        public MediaItem.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  int index,
                                                  java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • addRepeatedField

        public MediaItem.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • mergeFrom

        public MediaItem.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MediaItem.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • mergeFrom

        public MediaItem.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MediaItem.Builder>
        Throws:
        java.io.IOException
      • getId

        public java.lang.String getId()
         Identifier for the media item. This is a persistent identifier that can be
         used between sessions to identify this media item.
         
        string id = 1;
        Specified by:
        getId in interface MediaItemOrBuilder
        Returns:
        The id.
      • getIdBytes

        public com.google.protobuf.ByteString getIdBytes()
         Identifier for the media item. This is a persistent identifier that can be
         used between sessions to identify this media item.
         
        string id = 1;
        Specified by:
        getIdBytes in interface MediaItemOrBuilder
        Returns:
        The bytes for id.
      • setId

        public MediaItem.Builder setId​(java.lang.String value)
         Identifier for the media item. This is a persistent identifier that can be
         used between sessions to identify this media item.
         
        string id = 1;
        Parameters:
        value - The id to set.
        Returns:
        This builder for chaining.
      • clearId

        public MediaItem.Builder clearId()
         Identifier for the media item. This is a persistent identifier that can be
         used between sessions to identify this media item.
         
        string id = 1;
        Returns:
        This builder for chaining.
      • setIdBytes

        public MediaItem.Builder setIdBytes​(com.google.protobuf.ByteString value)
         Identifier for the media item. This is a persistent identifier that can be
         used between sessions to identify this media item.
         
        string id = 1;
        Parameters:
        value - The bytes for id to set.
        Returns:
        This builder for chaining.
      • getDescription

        public java.lang.String getDescription()
         Description of the media item. This is shown to the user in the item's
         info section in the Google Photos app.
         
        string description = 2;
        Specified by:
        getDescription in interface MediaItemOrBuilder
        Returns:
        The description.
      • getDescriptionBytes

        public com.google.protobuf.ByteString getDescriptionBytes()
         Description of the media item. This is shown to the user in the item's
         info section in the Google Photos app.
         
        string description = 2;
        Specified by:
        getDescriptionBytes in interface MediaItemOrBuilder
        Returns:
        The bytes for description.
      • setDescription

        public MediaItem.Builder setDescription​(java.lang.String value)
         Description of the media item. This is shown to the user in the item's
         info section in the Google Photos app.
         
        string description = 2;
        Parameters:
        value - The description to set.
        Returns:
        This builder for chaining.
      • clearDescription

        public MediaItem.Builder clearDescription()
         Description of the media item. This is shown to the user in the item's
         info section in the Google Photos app.
         
        string description = 2;
        Returns:
        This builder for chaining.
      • setDescriptionBytes

        public MediaItem.Builder setDescriptionBytes​(com.google.protobuf.ByteString value)
         Description of the media item. This is shown to the user in the item's
         info section in the Google Photos app.
         
        string description = 2;
        Parameters:
        value - The bytes for description to set.
        Returns:
        This builder for chaining.
      • getProductUrl

        public java.lang.String getProductUrl()
         Google Photos URL for the media item. This link is available to
         the user only if they're signed in.
         
        string product_url = 3;
        Specified by:
        getProductUrl in interface MediaItemOrBuilder
        Returns:
        The productUrl.
      • getProductUrlBytes

        public com.google.protobuf.ByteString getProductUrlBytes()
         Google Photos URL for the media item. This link is available to
         the user only if they're signed in.
         
        string product_url = 3;
        Specified by:
        getProductUrlBytes in interface MediaItemOrBuilder
        Returns:
        The bytes for productUrl.
      • setProductUrl

        public MediaItem.Builder setProductUrl​(java.lang.String value)
         Google Photos URL for the media item. This link is available to
         the user only if they're signed in.
         
        string product_url = 3;
        Parameters:
        value - The productUrl to set.
        Returns:
        This builder for chaining.
      • clearProductUrl

        public MediaItem.Builder clearProductUrl()
         Google Photos URL for the media item. This link is available to
         the user only if they're signed in.
         
        string product_url = 3;
        Returns:
        This builder for chaining.
      • setProductUrlBytes

        public MediaItem.Builder setProductUrlBytes​(com.google.protobuf.ByteString value)
         Google Photos URL for the media item. This link is available to
         the user only if they're signed in.
         
        string product_url = 3;
        Parameters:
        value - The bytes for productUrl to set.
        Returns:
        This builder for chaining.
      • getBaseUrl

        public java.lang.String getBaseUrl()
         A URL to the media item's bytes. This shouldn't be used as is. Parameters
         should be appended to this URL before use. See the [developer
         documentation](https://developers.google.com/photos/library/guides/access-media-items#base-urls)
         for a complete list of supported parameters. For example, `'=w2048-h1024'`
         will set the dimensions of a media item of type photo to have a width of
         2048 px and height of 1024 px.
         
        string base_url = 4;
        Specified by:
        getBaseUrl in interface MediaItemOrBuilder
        Returns:
        The baseUrl.
      • getBaseUrlBytes

        public com.google.protobuf.ByteString getBaseUrlBytes()
         A URL to the media item's bytes. This shouldn't be used as is. Parameters
         should be appended to this URL before use. See the [developer
         documentation](https://developers.google.com/photos/library/guides/access-media-items#base-urls)
         for a complete list of supported parameters. For example, `'=w2048-h1024'`
         will set the dimensions of a media item of type photo to have a width of
         2048 px and height of 1024 px.
         
        string base_url = 4;
        Specified by:
        getBaseUrlBytes in interface MediaItemOrBuilder
        Returns:
        The bytes for baseUrl.
      • setBaseUrl

        public MediaItem.Builder setBaseUrl​(java.lang.String value)
         A URL to the media item's bytes. This shouldn't be used as is. Parameters
         should be appended to this URL before use. See the [developer
         documentation](https://developers.google.com/photos/library/guides/access-media-items#base-urls)
         for a complete list of supported parameters. For example, `'=w2048-h1024'`
         will set the dimensions of a media item of type photo to have a width of
         2048 px and height of 1024 px.
         
        string base_url = 4;
        Parameters:
        value - The baseUrl to set.
        Returns:
        This builder for chaining.
      • clearBaseUrl

        public MediaItem.Builder clearBaseUrl()
         A URL to the media item's bytes. This shouldn't be used as is. Parameters
         should be appended to this URL before use. See the [developer
         documentation](https://developers.google.com/photos/library/guides/access-media-items#base-urls)
         for a complete list of supported parameters. For example, `'=w2048-h1024'`
         will set the dimensions of a media item of type photo to have a width of
         2048 px and height of 1024 px.
         
        string base_url = 4;
        Returns:
        This builder for chaining.
      • setBaseUrlBytes

        public MediaItem.Builder setBaseUrlBytes​(com.google.protobuf.ByteString value)
         A URL to the media item's bytes. This shouldn't be used as is. Parameters
         should be appended to this URL before use. See the [developer
         documentation](https://developers.google.com/photos/library/guides/access-media-items#base-urls)
         for a complete list of supported parameters. For example, `'=w2048-h1024'`
         will set the dimensions of a media item of type photo to have a width of
         2048 px and height of 1024 px.
         
        string base_url = 4;
        Parameters:
        value - The bytes for baseUrl to set.
        Returns:
        This builder for chaining.
      • getMimeType

        public java.lang.String getMimeType()
         MIME type of the media item. For example, `image/jpeg`.
         
        string mime_type = 5;
        Specified by:
        getMimeType in interface MediaItemOrBuilder
        Returns:
        The mimeType.
      • getMimeTypeBytes

        public com.google.protobuf.ByteString getMimeTypeBytes()
         MIME type of the media item. For example, `image/jpeg`.
         
        string mime_type = 5;
        Specified by:
        getMimeTypeBytes in interface MediaItemOrBuilder
        Returns:
        The bytes for mimeType.
      • setMimeType

        public MediaItem.Builder setMimeType​(java.lang.String value)
         MIME type of the media item. For example, `image/jpeg`.
         
        string mime_type = 5;
        Parameters:
        value - The mimeType to set.
        Returns:
        This builder for chaining.
      • clearMimeType

        public MediaItem.Builder clearMimeType()
         MIME type of the media item. For example, `image/jpeg`.
         
        string mime_type = 5;
        Returns:
        This builder for chaining.
      • setMimeTypeBytes

        public MediaItem.Builder setMimeTypeBytes​(com.google.protobuf.ByteString value)
         MIME type of the media item. For example, `image/jpeg`.
         
        string mime_type = 5;
        Parameters:
        value - The bytes for mimeType to set.
        Returns:
        This builder for chaining.
      • hasMediaMetadata

        public boolean hasMediaMetadata()
         Metadata related to the media item, such as, height, width, or
         creation time.
         
        .google.photos.types.MediaMetadata media_metadata = 6;
        Specified by:
        hasMediaMetadata in interface MediaItemOrBuilder
        Returns:
        Whether the mediaMetadata field is set.
      • getMediaMetadata

        public MediaMetadata getMediaMetadata()
         Metadata related to the media item, such as, height, width, or
         creation time.
         
        .google.photos.types.MediaMetadata media_metadata = 6;
        Specified by:
        getMediaMetadata in interface MediaItemOrBuilder
        Returns:
        The mediaMetadata.
      • setMediaMetadata

        public MediaItem.Builder setMediaMetadata​(MediaMetadata value)
         Metadata related to the media item, such as, height, width, or
         creation time.
         
        .google.photos.types.MediaMetadata media_metadata = 6;
      • setMediaMetadata

        public MediaItem.Builder setMediaMetadata​(MediaMetadata.Builder builderForValue)
         Metadata related to the media item, such as, height, width, or
         creation time.
         
        .google.photos.types.MediaMetadata media_metadata = 6;
      • mergeMediaMetadata

        public MediaItem.Builder mergeMediaMetadata​(MediaMetadata value)
         Metadata related to the media item, such as, height, width, or
         creation time.
         
        .google.photos.types.MediaMetadata media_metadata = 6;
      • clearMediaMetadata

        public MediaItem.Builder clearMediaMetadata()
         Metadata related to the media item, such as, height, width, or
         creation time.
         
        .google.photos.types.MediaMetadata media_metadata = 6;
      • getMediaMetadataBuilder

        public MediaMetadata.Builder getMediaMetadataBuilder()
         Metadata related to the media item, such as, height, width, or
         creation time.
         
        .google.photos.types.MediaMetadata media_metadata = 6;
      • hasContributorInfo

        public boolean hasContributorInfo()
         Information about the user who created this media item.
         
        .google.photos.types.ContributorInfo contributor_info = 7;
        Specified by:
        hasContributorInfo in interface MediaItemOrBuilder
        Returns:
        Whether the contributorInfo field is set.
      • getContributorInfo

        public ContributorInfo getContributorInfo()
         Information about the user who created this media item.
         
        .google.photos.types.ContributorInfo contributor_info = 7;
        Specified by:
        getContributorInfo in interface MediaItemOrBuilder
        Returns:
        The contributorInfo.
      • setContributorInfo

        public MediaItem.Builder setContributorInfo​(ContributorInfo value)
         Information about the user who created this media item.
         
        .google.photos.types.ContributorInfo contributor_info = 7;
      • setContributorInfo

        public MediaItem.Builder setContributorInfo​(ContributorInfo.Builder builderForValue)
         Information about the user who created this media item.
         
        .google.photos.types.ContributorInfo contributor_info = 7;
      • mergeContributorInfo

        public MediaItem.Builder mergeContributorInfo​(ContributorInfo value)
         Information about the user who created this media item.
         
        .google.photos.types.ContributorInfo contributor_info = 7;
      • clearContributorInfo

        public MediaItem.Builder clearContributorInfo()
         Information about the user who created this media item.
         
        .google.photos.types.ContributorInfo contributor_info = 7;
      • getContributorInfoBuilder

        public ContributorInfo.Builder getContributorInfoBuilder()
         Information about the user who created this media item.
         
        .google.photos.types.ContributorInfo contributor_info = 7;
      • getFilename

        public java.lang.String getFilename()
         Filename of the media item. This is shown to the user in the item's info
         section in the Google Photos app.
         
        string filename = 8;
        Specified by:
        getFilename in interface MediaItemOrBuilder
        Returns:
        The filename.
      • getFilenameBytes

        public com.google.protobuf.ByteString getFilenameBytes()
         Filename of the media item. This is shown to the user in the item's info
         section in the Google Photos app.
         
        string filename = 8;
        Specified by:
        getFilenameBytes in interface MediaItemOrBuilder
        Returns:
        The bytes for filename.
      • setFilename

        public MediaItem.Builder setFilename​(java.lang.String value)
         Filename of the media item. This is shown to the user in the item's info
         section in the Google Photos app.
         
        string filename = 8;
        Parameters:
        value - The filename to set.
        Returns:
        This builder for chaining.
      • clearFilename

        public MediaItem.Builder clearFilename()
         Filename of the media item. This is shown to the user in the item's info
         section in the Google Photos app.
         
        string filename = 8;
        Returns:
        This builder for chaining.
      • setFilenameBytes

        public MediaItem.Builder setFilenameBytes​(com.google.protobuf.ByteString value)
         Filename of the media item. This is shown to the user in the item's info
         section in the Google Photos app.
         
        string filename = 8;
        Parameters:
        value - The bytes for filename to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final MediaItem.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>
      • mergeUnknownFields

        public final MediaItem.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<MediaItem.Builder>