1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00
filebot/source/net/filebot/web/Trailer.java
2017-02-08 23:17:05 +08:00

44 lines
813 B
Java

package net.filebot.web;
import java.io.Serializable;
import java.util.Map;
public class Trailer implements Serializable {
protected String type;
protected String name;
protected Map<String, String> sources;
public Trailer() {
// used by serializer
}
public Trailer(String type, String name, Map<String, String> sources) {
this.type = type;
this.name = name;
this.sources = sources;
}
public String getType() {
return type;
}
public String getName() {
return name;
}
public Map<String, String> getSources() {
return sources;
}
public String getSource(String size) {
return sources.containsKey(size) ? sources.get(size) : sources.values().iterator().next();
}
@Override
public String toString() {
return String.format("%s %s (%s)", name, sources.keySet(), type);
}
}