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

org.tinymediamanager.scraper.entities.MediaTrailer Maven / Gradle / Ivy

There is a newer version: 3.0.5
Show newest version
/*
 * Copyright 2012 - 2019 Manuel Laggner
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.tinymediamanager.scraper.entities;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.tinymediamanager.scraper.util.StrgUtils;

/**
 * The class MediaTrailer. This is used for holding data about trailer
 * 
 * @author Manuel Laggner
 * @since 1.0
 */
public class MediaTrailer implements Comparable {
  private String name     = "";
  private String url      = "";
  private String quality  = "";
  private String provider = "";
  private String date     = "";

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = StrgUtils.getNonNullString(name);
  }

  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = StrgUtils.getNonNullString(url);
  }

  public String getQuality() {
    return quality;
  }

  public void setQuality(String quality) {
    this.quality = StrgUtils.getNonNullString(quality);
  }

  public String getProvider() {
    return provider;
  }

  public void setProvider(String provider) {
    this.provider = StrgUtils.getNonNullString(provider);
  }

  public String getDate() {
    return date;
  }

  public void setDate(String date) {
    this.date = StrgUtils.getNonNullString(date);
  }

  /**
   * 

* Uses ReflectionToStringBuilder to generate a toString for the specified object. *

* * @return the String result * @see ReflectionToStringBuilder#toString(Object) */ @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE); } @Override public boolean equals(Object mt2) { if ((mt2 != null) && (mt2 instanceof MediaTrailer)) { return compareTo((MediaTrailer) mt2) == 0; } return false; } @Override public int compareTo(MediaTrailer mt2) { return getUrl().compareTo(mt2.getUrl()); } @Override public int hashCode() { return getUrl().hashCode(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy