Minor Bugfix

This commit is contained in:
giuseppe.bueti 2016-02-07 20:29:30 +01:00 committed by Giuseppe Bueti
parent 6db36f902b
commit 33223becff
2 changed files with 17 additions and 17 deletions

View File

@ -13,7 +13,7 @@ import javax.xml.bind.annotation.XmlType;
"country", "country",
"director", "director",
"genre", "genre",
"imdbID", "imdbId",
"imdbRating", "imdbRating",
"imdbVotes", "imdbVotes",
"language", "language",
@ -36,7 +36,7 @@ public class Movie {
protected String country; protected String country;
protected String director; protected String director;
protected String genre; protected String genre;
protected String imdbID; protected String imdbId;
protected String imdbRating; protected String imdbRating;
protected String imdbVotes; protected String imdbVotes;
protected String language; 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 * @return
* possible object is * possible object is
* {@link String } * {@link String }
* *
*/ */
public String getImdbID() { public String getImdbId() {
return imdbID; return imdbId;
} }
/** /**
* Imposta il valore della propriet<EFBFBD> imdbID. * Imposta il valore della propriet<EFBFBD> imdbId.
* *
* @param value * @param value
* allowed object is * allowed object is
* {@link String } * {@link String }
* *
*/ */
public void setImdbID(String value) { public void setImdbId(String value) {
this.imdbID = value; this.imdbId = value;
} }
/** /**
@ -540,7 +540,7 @@ public class Movie {
", country='" + country + '\'' + ", country='" + country + '\'' +
", director='" + director + '\'' + ", director='" + director + '\'' +
", genre='" + genre + '\'' + ", genre='" + genre + '\'' +
", imdbID='" + imdbID + '\'' + ", imdbId='" + imdbId + '\'' +
", imdbRating='" + imdbRating + '\'' + ", imdbRating='" + imdbRating + '\'' +
", imdbVotes='" + imdbVotes + '\'' + ", imdbVotes='" + imdbVotes + '\'' +
", language='" + language + '\'' + ", language='" + language + '\'' +
@ -564,14 +564,14 @@ public class Movie {
Movie movie = (Movie) o; 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; return title != null ? title.equals(movie.title) : movie.title == null;
} }
@Override @Override
public int hashCode() { 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); result = 31 * result + (title != null ? title.hashCode() : 0);
return result; return result;
} }

View File

@ -22,7 +22,7 @@ public class MovieCrudService {
@GET @GET
@Path("/getinfo") @Path("/getinfo")
@Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @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***"); System.out.println("*** Calling getinfo for a given ImdbID***");
@ -40,12 +40,12 @@ public class MovieCrudService {
System.out.println("*** Calling addMovie ***"); System.out.println("*** Calling addMovie ***");
if (null!=inventory.get(movie.getImdbID())){ if (null!=inventory.get(movie.getImdbId())){
return Response.status(Response.Status.NOT_MODIFIED) return Response.status(Response.Status.NOT_MODIFIED)
.entity("Movie is Already in the database.").build(); .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(); return Response.status(Response.Status.CREATED).build();
} }
@ -58,11 +58,11 @@ public class MovieCrudService {
System.out.println("*** Calling updateMovie ***"); System.out.println("*** Calling updateMovie ***");
if (null==inventory.get(movie.getImdbID())){ if (null==inventory.get(movie.getImdbId())){
return Response.status(Response.Status.NOT_MODIFIED) return Response.status(Response.Status.NOT_MODIFIED)
.entity("Movie is not in the database.\nUnable to Update").build(); .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(); return Response.status(Response.Status.OK).build();
} }
@ -70,7 +70,7 @@ public class MovieCrudService {
@DELETE @DELETE
@Path("/deletemovie") @Path("/deletemovie")
public Response deleteMovie(@QueryParam("imdbID") String imdbID){ public Response deleteMovie(@QueryParam("imdbId") String imdbID){
System.out.println("*** Calling deleteMovie ***"); System.out.println("*** Calling deleteMovie ***");