Java tutorial
/* * Copyright (c) 2004-2016 YAMJ Members * https://github.com/orgs/YAMJ/people * * This file is part of the Yet Another Movie Jukebox (YAMJ) project. * * 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 YAMJ. If not, see <http://www.gnu.org/licenses/>. * * Web: https://github.com/YAMJ/yamj-v2 * */ package com.moviejukebox.model; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; public class Image implements IImage { public static final IImage UNKNOWN = new Image(); private String url; private String subimage; public Image() { this(Movie.UNKNOWN, Movie.UNKNOWN); } public Image(String url) { this(url, Movie.UNKNOWN); } public Image(String url, String subimage) { this.url = url; this.subimage = subimage; } @Override public String getUrl() { return url; } @Override public void setUrl(String url) { this.url = url; } @Override public String getSubimage() { return subimage; } @Override public void setSubimage(String subimage) { this.subimage = subimage; } @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append(url).append(subimage).toString(); } }