All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.moviejukebox.model.Attachment.Attachment Maven / Gradle / Ivy

The newest version!
/*
 *      Copyright (c) 2004-2013 YAMJ Members
 *      http://code.google.com/p/moviejukebox/people/list
 *
 *      This file is part of the Yet Another Movie Jukebox (YAMJ).
 *
 *      The YAMJ is free software: you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation, either version 3 of the License, or
 *      any later version.
 *
 *      YAMJ is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with the YAMJ.  If not, see .
 *
 *      Web: http://code.google.com/p/moviejukebox/
 *
 */
package com.moviejukebox.model.Attachment;

import java.io.File;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

/**
 * File attachment;
 *
 * @author modmax
 */
@XmlType
public class Attachment {

    private AttachmentType type;
    private int attachmentId;
    private ContentType contentType;
    private String mimeType;
    private int part; // only relevant for video images
    private File sourceFile;

    @XmlElement
    public AttachmentType getType() {
        return type;
    }

    public void setType(AttachmentType type) {
        this.type = type;
    }

    @XmlElement
    public int getAttachmentId() {
        return attachmentId;
    }

    public void setAttachmentId(int attachmentId) {
        this.attachmentId = attachmentId;
    }

    @XmlElement
    public ContentType getContentType() {
        return contentType;
    }

    public void setContentType(ContentType contentType) {
        this.contentType = contentType;
    }

    @XmlElement
    public String getMimeType() {
        return mimeType;
    }

    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

    @XmlElement
    public int getPart() {
        return part;
    }

    public void setPart(int part) {
        this.part = part;
    }

    @XmlTransient
    public File getSourceFile() {
        return sourceFile;
    }

    public void setSourceFile(File sourceFile) {
        this.sourceFile = sourceFile;
    }

    @Override
    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("Id=");
        sb.append(this.getAttachmentId());
        sb.append(", Content=");
        sb.append(this.getContentType());
        sb.append(", Part=");
        sb.append(this.getPart());
        sb.append(", MimeType=");
        sb.append(this.getMimeType());
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy