CleanUp and reformatting Code.
This commit is contained in:
parent
37acdef2a7
commit
06bbf19265
|
@ -26,7 +26,6 @@ public class MovieCrudService {
|
||||||
return inventory.get(imdbId);
|
return inventory.get(imdbId);
|
||||||
} else
|
} else
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
@ -41,7 +40,6 @@ public class MovieCrudService {
|
||||||
}
|
}
|
||||||
|
|
||||||
inventory.put(movie.getImdbId(), movie);
|
inventory.put(movie.getImdbId(), movie);
|
||||||
|
|
||||||
return Response.status(Response.Status.CREATED).build();
|
return Response.status(Response.Status.CREATED).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,9 +53,9 @@ public class MovieCrudService {
|
||||||
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();
|
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();
|
return Response.status(Response.Status.OK).build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
|
@ -80,7 +78,6 @@ public class MovieCrudService {
|
||||||
public List<Movie> listMovies() {
|
public List<Movie> listMovies() {
|
||||||
|
|
||||||
return inventory.values().stream().collect(Collectors.toCollection(ArrayList::new));
|
return inventory.values().stream().collect(Collectors.toCollection(ArrayList::new));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue