Skip to content

Commit

Permalink
Merge pull request #151 from c-eg/add-lombok
Browse files Browse the repository at this point in the history
Add lombok
  • Loading branch information
c-eg authored Jan 1, 2024
2 parents 47d2e03 + b5df333 commit 2eaafb8
Show file tree
Hide file tree
Showing 67 changed files with 289 additions and 2,302 deletions.
21 changes: 15 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ dependencies {
testImplementation 'org.slf4j:slf4j-simple:2.0.9'

// testing
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.6.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1'

// util
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.3'
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.3'
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'

implementation 'com.fasterxml.jackson.core:jackson-annotations:2.16.0'
implementation 'com.fasterxml.jackson.core:jackson-core:2.16.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.0'

implementation 'com.google.guava:guava:32.1.3-jre'
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'org.apache.commons:commons-lang3:3.14.0'
implementation 'commons-codec:commons-codec:1.16.0'
}

Expand All @@ -39,6 +44,10 @@ java {
withSourcesJar()
}

test {
useJUnitPlatform()
}

checkstyle {
toolVersion '10.12.5'
configFile file("config/checkstyle/checkstyle.xml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,15 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import info.movito.themoviedbapi.model.core.AbstractJsonMapping;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class AlternativeTitle extends AbstractJsonMapping {
@JsonProperty("iso_3166_1")
private String country;

@JsonProperty("title")
private String title;

public String getCountry() {
return country;
}

public void setCountry(String country) {
this.country = country;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}
}
76 changes: 4 additions & 72 deletions src/main/java/info/movito/themoviedbapi/model/Artwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import info.movito.themoviedbapi.model.core.AbstractJsonMapping;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class Artwork extends AbstractJsonMapping {
@JsonProperty("iso_639_1")
private String language;
Expand All @@ -29,76 +33,4 @@ public class Artwork extends AbstractJsonMapping {
private String flag;

private ArtworkType artworkType = ArtworkType.POSTER;

public ArtworkType getArtworkType() {
return artworkType;
}

public void setArtworkType(ArtworkType artworkType) {
this.artworkType = artworkType;
}

public float getAspectRatio() {
return aspectRatio;
}

public void setAspectRatio(float aspectRatio) {
this.aspectRatio = aspectRatio;
}

public String getFilePath() {
return filePath;
}

public void setFilePath(String filePath) {
this.filePath = filePath;
}

public int getHeight() {
return height;
}

public void setHeight(int height) {
this.height = height;
}

public String getLanguage() {
return language;
}

public void setLanguage(String language) {
this.language = language;
}

public int getWidth() {
return width;
}

public void setWidth(int width) {
this.width = width;
}

public float getVoteAverage() {
return voteAverage;
}

public void setVoteAverage(float voteAverage) {
this.voteAverage = voteAverage;
}

public int getVoteCount() {
return voteCount;
}

public void setVoteCount(int voteCount) {
this.voteCount = voteCount;
}

public String getFlag() {
return flag;
}

public void setFlag(String flag) {
this.flag = flag;
}
}
36 changes: 4 additions & 32 deletions src/main/java/info/movito/themoviedbapi/model/Collection.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import info.movito.themoviedbapi.model.core.IdElement;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

@Data
@EqualsAndHashCode(callSuper = true)
@JsonRootName("collection")
public class Collection extends IdElement {
@JsonProperty("title")
Expand All @@ -22,30 +26,6 @@ public class Collection extends IdElement {
@JsonProperty("release_date")
private String releaseDate;

public String getBackdropPath() {
return backdropPath;
}

public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}

public String getPosterPath() {
return posterPath;
}

public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}

public String getReleaseDate() {
return releaseDate;
}

public void setReleaseDate(String releaseDate) {
this.releaseDate = releaseDate;
}

/**
* Gets the title, or name, if the title is blank.
*
Expand All @@ -58,10 +38,6 @@ public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

/**
* Gets the name, or title, if the name is blank.
*
Expand All @@ -73,8 +49,4 @@ public String getName() {
}
return name;
}

public void setName(String name) {
this.name = name;
}
}
36 changes: 4 additions & 32 deletions src/main/java/info/movito/themoviedbapi/model/CollectionInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import info.movito.themoviedbapi.model.core.NamedIdElement;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
public class CollectionInfo extends NamedIdElement {
@JsonProperty("overview")
private String overview;
Expand All @@ -17,36 +21,4 @@ public class CollectionInfo extends NamedIdElement {

@JsonProperty("parts")
private List<Collection> parts;

public String getBackdropPath() {
return backdropPath;
}

public void setBackdropPath(String backdropPath) {
this.backdropPath = backdropPath;
}

public String getOverview() {
return overview;
}

public void setOverview(String overview) {
this.overview = overview;
}

public List<Collection> getParts() {
return parts;
}

public void setParts(List<Collection> parts) {
this.parts = parts;
}

public String getPosterPath() {
return posterPath;
}

public void setPosterPath(String posterPath) {
this.posterPath = posterPath;
}
}
44 changes: 4 additions & 40 deletions src/main/java/info/movito/themoviedbapi/model/Company.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import info.movito.themoviedbapi.model.core.NamedIdElement;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class Company extends NamedIdElement {
@JsonProperty("description")
private String description;
Expand All @@ -20,46 +24,6 @@ public class Company extends NamedIdElement {
@JsonProperty("parent_company")
private Company parentCompany;

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public String getHeadquarters() {
return headquarters;
}

public void setHeadquarters(String headquarters) {
this.headquarters = headquarters;
}

public String getHomepage() {
return homepage;
}

public void setHomepage(String homepage) {
this.homepage = homepage;
}

public String getLogoPath() {
return logoPath;
}

public void setLogoPath(String logoPath) {
this.logoPath = logoPath;
}

public Company getParentCompany() {
return parentCompany;
}

public void setParentCompany(Company parentCompany) {
this.parentCompany = parentCompany;
}

/**
* Sets the parent company.
*/
Expand Down
21 changes: 4 additions & 17 deletions src/main/java/info/movito/themoviedbapi/model/ContentRating.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import info.movito.themoviedbapi.model.core.IdElement;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
@JsonRootName("content_ratings")
public class ContentRating implements Serializable {
@JsonProperty("iso_3166_1")
Expand All @@ -15,24 +19,7 @@ public class ContentRating implements Serializable {
@JsonProperty("rating")
private String rating;

public String getLocale() {
return locale;
}

public void setLocale(String locale) {
this.locale = locale;
}

public String getRating() {
return rating;
}

public void setRating(String rating) {
this.rating = rating;
}

public static class Results extends IdElement {

@JsonProperty("results")
private List<ContentRating> results;

Expand Down
Loading

0 comments on commit 2eaafb8

Please sign in to comment.