From c1e0241f052f44b4d1235dc695b1761a287c6cf0 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Mon, 17 Sep 2018 13:02:38 +0100 Subject: [PATCH] Removed unused imports; --- .../co/neviyn/Observations/core/Observation.java | 10 ++++------ .../Observations/resources/SiteResource.java | 15 ++++++--------- .../Observations/resources/TutorResource.java | 10 ++++------ 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/backend/src/main/java/uk/co/neviyn/Observations/core/Observation.java b/backend/src/main/java/uk/co/neviyn/Observations/core/Observation.java index e6f204b..aaf3b30 100644 --- a/backend/src/main/java/uk/co/neviyn/Observations/core/Observation.java +++ b/backend/src/main/java/uk/co/neviyn/Observations/core/Observation.java @@ -3,8 +3,6 @@ package uk.co.neviyn.Observations.core; import com.fasterxml.jackson.annotation.JsonProperty; import java.sql.ResultSet; import java.sql.SQLException; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.NonNull; @@ -44,8 +42,8 @@ public class Observation { @JsonProperty private DateTime date; - public Observation(int siteId, String observed, int monitoring, int control, int conservatism, - int teamwork, int knowledge, String rawData) { + public Observation(int siteId, String observed, int monitoring, int control, int conservatism, int teamwork, + int knowledge, String rawData) { this.siteId = siteId; this.observed = observed; this.monitoring = monitoring; @@ -57,7 +55,7 @@ public class Observation { } private Observation(int id, int siteId, String observed, String type, int monitoring, int control, int conservatism, - int teamwork, int knowledge, String rawData, DateTime date) { + int teamwork, int knowledge, String rawData, DateTime date) { this.id = id; this.siteId = siteId; this.observed = observed; @@ -71,7 +69,7 @@ public class Observation { this.date = date; } - public static class Mapper implements RowMapper{ + public static class Mapper implements RowMapper { public Observation map(ResultSet rs, StatementContext ctx) throws SQLException { return new Observation(rs.getInt("id"), rs.getInt("siteId"), rs.getString("observed"), rs.getString("type"), diff --git a/backend/src/main/java/uk/co/neviyn/Observations/resources/SiteResource.java b/backend/src/main/java/uk/co/neviyn/Observations/resources/SiteResource.java index 9c2deff..40599d2 100644 --- a/backend/src/main/java/uk/co/neviyn/Observations/resources/SiteResource.java +++ b/backend/src/main/java/uk/co/neviyn/Observations/resources/SiteResource.java @@ -1,8 +1,6 @@ package uk.co.neviyn.Observations.resources; - import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import uk.co.neviyn.Observations.api.SelectOption; import uk.co.neviyn.Observations.dao.SiteDao; @@ -16,14 +14,13 @@ import java.util.stream.Collectors; @RequiredArgsConstructor @Produces(MediaType.APPLICATION_JSON) @Path("/site") -@Slf4j public class SiteResource { - private final SiteDao dao; + private final SiteDao dao; - @Path("/all") - @GET - public List> allSites(){ - return dao.allSites().stream().map(x -> new SelectOption<>(x.getName(), x.getId())).collect(Collectors.toList()); - } + @Path("/all") + @GET + public List> allSites() { + return dao.allSites().stream().map(x -> new SelectOption<>(x.getName(), x.getId())).collect(Collectors.toList()); + } } diff --git a/backend/src/main/java/uk/co/neviyn/Observations/resources/TutorResource.java b/backend/src/main/java/uk/co/neviyn/Observations/resources/TutorResource.java index 9837df9..0f86590 100644 --- a/backend/src/main/java/uk/co/neviyn/Observations/resources/TutorResource.java +++ b/backend/src/main/java/uk/co/neviyn/Observations/resources/TutorResource.java @@ -10,7 +10,6 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; import uk.co.neviyn.Observations.api.SelectOption; import uk.co.neviyn.Observations.core.Tutor; import uk.co.neviyn.Observations.dao.TutorDao; @@ -18,25 +17,24 @@ import uk.co.neviyn.Observations.dao.TutorDao; @RequiredArgsConstructor @Produces(MediaType.APPLICATION_JSON) @Path("/tutor") -@Slf4j public class TutorResource { private final TutorDao dao; @Path("/all") @GET - public List allTutors(){ + public List allTutors() { List tutors = dao.allTutors(); - if(tutors != null && !tutors.isEmpty()) + if (tutors != null && !tutors.isEmpty()) return tutors; throw new WebApplicationException("No tutors found!", Response.Status.NOT_FOUND); } @Path("/site/{id}") @GET - public List> tutorsForSite(@PathParam("id")int siteId){ + public List> tutorsForSite(@PathParam("id") int siteId) { List tutors = dao.tutorsForSite(siteId); - if(tutors != null && !tutors.isEmpty()){ + if (tutors != null && !tutors.isEmpty()) { return tutors.stream().map(x -> new SelectOption<>(x.getName(), x.getId())).collect(Collectors.toList()); } throw new WebApplicationException("No tutors found!", Response.Status.NOT_FOUND);