Minor Bugfix
This commit is contained in:
parent
6db36f902b
commit
33223becff
|
@ -13,7 +13,7 @@ import javax.xml.bind.annotation.XmlType;
|
|||
"country",
|
||||
"director",
|
||||
"genre",
|
||||
"imdbID",
|
||||
"imdbId",
|
||||
"imdbRating",
|
||||
"imdbVotes",
|
||||
"language",
|
||||
|
@ -36,7 +36,7 @@ public class Movie {
|
|||
protected String country;
|
||||
protected String director;
|
||||
protected String genre;
|
||||
protected String imdbID;
|
||||
protected String imdbId;
|
||||
protected String imdbRating;
|
||||
protected String imdbVotes;
|
||||
protected String language;
|
||||
|
@ -173,27 +173,27 @@ public class Movie {
|
|||
}
|
||||
|
||||
/**
|
||||
* Recupera il valore della propriet<EFBFBD> imdbID.
|
||||
* Recupera il valore della propriet<EFBFBD> imdbId.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getImdbID() {
|
||||
return imdbID;
|
||||
public String getImdbId() {
|
||||
return imdbId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Imposta il valore della propriet<EFBFBD> imdbID.
|
||||
* Imposta il valore della propriet<EFBFBD> imdbId.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setImdbID(String value) {
|
||||
this.imdbID = value;
|
||||
public void setImdbId(String value) {
|
||||
this.imdbId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -540,7 +540,7 @@ public class Movie {
|
|||
", country='" + country + '\'' +
|
||||
", director='" + director + '\'' +
|
||||
", genre='" + genre + '\'' +
|
||||
", imdbID='" + imdbID + '\'' +
|
||||
", imdbId='" + imdbId + '\'' +
|
||||
", imdbRating='" + imdbRating + '\'' +
|
||||
", imdbVotes='" + imdbVotes + '\'' +
|
||||
", language='" + language + '\'' +
|
||||
|
@ -564,14 +564,14 @@ public class Movie {
|
|||
|
||||
Movie movie = (Movie) o;
|
||||
|
||||
if (imdbID != null ? !imdbID.equals(movie.imdbID) : movie.imdbID != null) return false;
|
||||
if (imdbId != null ? !imdbId.equals(movie.imdbId) : movie.imdbId != null) return false;
|
||||
return title != null ? title.equals(movie.title) : movie.title == null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = imdbID != null ? imdbID.hashCode() : 0;
|
||||
int result = imdbId != null ? imdbId.hashCode() : 0;
|
||||
result = 31 * result + (title != null ? title.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class MovieCrudService {
|
|||
@GET
|
||||
@Path("/getinfo")
|
||||
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
|
||||
public Movie movieByImdbID(@QueryParam("imdbID") String imdbID){
|
||||
public Movie movieByImdbID(@QueryParam("imdbId") String imdbID){
|
||||
|
||||
System.out.println("*** Calling getinfo for a given ImdbID***");
|
||||
|
||||
|
@ -40,12 +40,12 @@ public class MovieCrudService {
|
|||
|
||||
System.out.println("*** Calling addMovie ***");
|
||||
|
||||
if (null!=inventory.get(movie.getImdbID())){
|
||||
if (null!=inventory.get(movie.getImdbId())){
|
||||
return Response.status(Response.Status.NOT_MODIFIED)
|
||||
.entity("Movie is Already in the database.").build();
|
||||
}
|
||||
|
||||
inventory.put(movie.getImdbID(),movie);
|
||||
inventory.put(movie.getImdbId(),movie);
|
||||
|
||||
return Response.status(Response.Status.CREATED).build();
|
||||
}
|
||||
|
@ -58,11 +58,11 @@ public class MovieCrudService {
|
|||
|
||||
System.out.println("*** Calling updateMovie ***");
|
||||
|
||||
if (null==inventory.get(movie.getImdbID())){
|
||||
if (null==inventory.get(movie.getImdbId())){
|
||||
return Response.status(Response.Status.NOT_MODIFIED)
|
||||
.entity("Movie is not in the database.\nUnable to Update").build();
|
||||
}
|
||||
inventory.put(movie.getImdbID(),movie);
|
||||
inventory.put(movie.getImdbId(),movie);
|
||||
return Response.status(Response.Status.OK).build();
|
||||
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class MovieCrudService {
|
|||
|
||||
@DELETE
|
||||
@Path("/deletemovie")
|
||||
public Response deleteMovie(@QueryParam("imdbID") String imdbID){
|
||||
public Response deleteMovie(@QueryParam("imdbId") String imdbID){
|
||||
|
||||
System.out.println("*** Calling deleteMovie ***");
|
||||
|
||||
|
|
Loading…
Reference in New Issue