Use Diamond interface
This commit is contained in:
@@ -31,7 +31,7 @@ public class ChangeKeyItem extends AbstractJsonMapping implements Serializable {
|
||||
@JsonProperty("key")
|
||||
private String key;
|
||||
@JsonProperty("items")
|
||||
private List<ChangedItem> changedItems = new ArrayList<ChangedItem>();
|
||||
private List<ChangedItem> changedItems = new ArrayList<>();
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CollectionInfo extends AbstractJsonMapping implements Serializable,
|
||||
@JsonProperty("backdrop_path")
|
||||
private String backdropPath;
|
||||
@JsonProperty("parts")
|
||||
private List<Collection> parts = new ArrayList<Collection>();
|
||||
private List<Collection> parts = new ArrayList<>();
|
||||
|
||||
public String getBackdropPath() {
|
||||
return backdropPath;
|
||||
|
||||
@@ -37,9 +37,9 @@ public abstract class AbstractWrapperBase extends AbstractJsonMapping {
|
||||
*/
|
||||
public <E extends Enum<E>> List<E> getTypeList(Class<E> clz, E[] typeList) {
|
||||
if (typeList.length > 0) {
|
||||
return new ArrayList<E>(Arrays.asList(typeList));
|
||||
return new ArrayList<>(Arrays.asList(typeList));
|
||||
} else {
|
||||
return new ArrayList<E>(EnumSet.allOf(clz));
|
||||
return new ArrayList<>(EnumSet.allOf(clz));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ public final class ResultList<T> extends AbstractWrapperIdPages {
|
||||
|
||||
public ResultList(List<T> resultList) {
|
||||
if (resultList == null) {
|
||||
results = new ArrayList<T>();
|
||||
results = new ArrayList<>();
|
||||
} else {
|
||||
results = new ArrayList<T>(resultList);
|
||||
results = new ArrayList<>(resultList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,9 +42,9 @@ public final class ResultsMap<K, V> extends AbstractWrapperIdPages {
|
||||
|
||||
public ResultsMap(Map<K, V> resultsMap) {
|
||||
if (resultsMap == null) {
|
||||
results = new HashMap<K, V>();
|
||||
results = new HashMap<>();
|
||||
} else {
|
||||
results = new HashMap<K, V>(resultsMap);
|
||||
results = new HashMap<>(resultsMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.List;
|
||||
public class WrapperChanges extends AbstractWrapperBase {
|
||||
|
||||
@JsonProperty("changes")
|
||||
private List<ChangeKeyItem> changedItems = new ArrayList<ChangeKeyItem>();
|
||||
private List<ChangeKeyItem> changedItems = new ArrayList<>();
|
||||
|
||||
public List<ChangeKeyItem> getChangedItems() {
|
||||
return changedItems;
|
||||
|
||||
@@ -21,7 +21,6 @@ package com.omertron.themoviedbapi.results;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.omertron.themoviedbapi.results.ResultList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -45,7 +44,7 @@ public class WrapperGenericList<T> extends AbstractWrapperAll {
|
||||
}
|
||||
|
||||
public ResultList<T> getResultsList() {
|
||||
ResultList<T> resultsList = new ResultList<T>(results);
|
||||
ResultList<T> resultsList = new ResultList<>(results);
|
||||
setResultProperties(resultsList);
|
||||
return resultsList;
|
||||
}
|
||||
|
||||
@@ -79,13 +79,13 @@ public class WrapperImages extends AbstractWrapperAll {
|
||||
* @return
|
||||
*/
|
||||
public List<Artwork> getAll(ArtworkType... artworkList) {
|
||||
List<Artwork> artwork = new ArrayList<Artwork>();
|
||||
List<Artwork> artwork = new ArrayList<>();
|
||||
List<ArtworkType> types;
|
||||
|
||||
if (artworkList.length > 0) {
|
||||
types = new ArrayList<ArtworkType>(Arrays.asList(artworkList));
|
||||
types = new ArrayList<>(Arrays.asList(artworkList));
|
||||
} else {
|
||||
types = new ArrayList<ArtworkType>(Arrays.asList(ArtworkType.values()));
|
||||
types = new ArrayList<>(Arrays.asList(ArtworkType.values()));
|
||||
}
|
||||
|
||||
// Add all the posters to the list
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WrapperVideos extends AbstractWrapperId {
|
||||
@JsonSetter("quicktime")
|
||||
public void setQuickTime(List<Trailer> trailers) {
|
||||
if (this.videos == null) {
|
||||
this.videos = new ArrayList<Video>();
|
||||
this.videos = new ArrayList<>();
|
||||
}
|
||||
|
||||
for (Trailer t : trailers) {
|
||||
@@ -56,7 +56,7 @@ public class WrapperVideos extends AbstractWrapperId {
|
||||
@JsonSetter("youtube")
|
||||
public void setYouTube(List<Trailer> trailers) {
|
||||
if (this.videos == null) {
|
||||
this.videos = new ArrayList<Video>();
|
||||
this.videos = new ArrayList<>();
|
||||
}
|
||||
|
||||
for (Trailer t : trailers) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ApiUrl {
|
||||
private final String apiKey;
|
||||
private final MethodBase method;
|
||||
private MethodSub submethod = MethodSub.NONE;
|
||||
private static final List<Param> IGNORE_PARAMS = new ArrayList<Param>();
|
||||
private static final List<Param> IGNORE_PARAMS = new ArrayList<>();
|
||||
|
||||
static {
|
||||
IGNORE_PARAMS.add(Param.ID);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class PostTools {
|
||||
// Jackson JSON configuration
|
||||
protected static final ObjectMapper MAPPER = new ObjectMapper();
|
||||
|
||||
private final Map<String, Object> values = new HashMap<String, Object>();
|
||||
private final Map<String, Object> values = new HashMap<>();
|
||||
|
||||
public PostTools() {
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.junit.Test;
|
||||
public class TmdbNetworksTest extends AbstractTests {
|
||||
|
||||
private static TmdbNetworks instance;
|
||||
private static final List<TestID> testIDs = new ArrayList<TestID>();
|
||||
private static final List<TestID> testIDs = new ArrayList<>();
|
||||
|
||||
public TmdbNetworksTest() {
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.junit.Test;
|
||||
public class TmdbSeasonsTest extends AbstractTests {
|
||||
|
||||
private static TmdbSeasons instance;
|
||||
private static final List<TestID> TV_IDS = new ArrayList<TestID>();
|
||||
private static final List<TestID> TV_IDS = new ArrayList<>();
|
||||
|
||||
public TmdbSeasonsTest() {
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ import org.junit.Test;
|
||||
public class TmdbTVTest extends AbstractTests {
|
||||
|
||||
private static TmdbTV instance;
|
||||
private static final List<TestID> TV_IDS = new ArrayList<TestID>();
|
||||
private static final List<TestID> TV_IDS = new ArrayList<>();
|
||||
|
||||
public TmdbTVTest() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user