formatting work

This commit is contained in:
eugenp
2016-10-12 08:02:05 +03:00
parent eb7650eead
commit 856be0a08a
128 changed files with 2039 additions and 2275 deletions

View File

@@ -8,9 +8,9 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class CompanyController {
@RequestMapping(value = "/companyRest", produces = MediaType.APPLICATION_JSON_VALUE)
public Company getCompanyRest() {
final Company company = new Company(1, "Xpto");
return company;
}
@RequestMapping(value = "/companyRest", produces = MediaType.APPLICATION_JSON_VALUE)
public Company getCompanyRest() {
final Company company = new Company(1, "Xpto");
return company;
}
}

View File

@@ -14,26 +14,26 @@ import com.fasterxml.jackson.annotation.JsonView;
@RestController
public class ItemController {
@JsonView(Views.Public.class)
@RequestMapping("/items/{id}")
public Item getItemPublic(@PathVariable final int id) {
return ItemManager.getById(id);
}
@JsonView(Views.Public.class)
@RequestMapping("/items/{id}")
public Item getItemPublic(@PathVariable final int id) {
return ItemManager.getById(id);
}
@JsonView(Views.Internal.class)
@RequestMapping("/items/internal/{id}")
public Item getItemInternal(@PathVariable final int id) {
return ItemManager.getById(id);
}
@JsonView(Views.Internal.class)
@RequestMapping("/items/internal/{id}")
public Item getItemInternal(@PathVariable final int id) {
return ItemManager.getById(id);
}
@RequestMapping("/date")
public Date getCurrentDate() throws Exception {
return new Date();
}
@RequestMapping("/date")
public Date getCurrentDate() throws Exception {
return new Date();
}
@RequestMapping("/delay/{seconds}")
public void getCurrentTime(@PathVariable final int seconds) throws Exception {
@RequestMapping("/delay/{seconds}")
public void getCurrentTime(@PathVariable final int seconds) throws Exception {
Thread.sleep(seconds * 1000);
}
Thread.sleep(seconds * 1000);
}
}

View File

@@ -6,8 +6,8 @@ import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpRespon
@ControllerAdvice
public class JsonpControllerAdvice extends AbstractJsonpResponseBodyAdvice {
public JsonpControllerAdvice() {
super("callback");
}
public JsonpControllerAdvice() {
super("callback");
}
}

View File

@@ -3,8 +3,8 @@ package org.baeldung.web.controller.status;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(value = HttpStatus.FORBIDDEN, reason="To show an example of a custom message")
@ResponseStatus(value = HttpStatus.FORBIDDEN, reason = "To show an example of a custom message")
public class ForbiddenException extends RuntimeException {
private static final long serialVersionUID = 6826605655586311552L;
private static final long serialVersionUID = 6826605655586311552L;
}

View File

@@ -2,37 +2,37 @@ package org.baeldung.web.dto;
public class Company {
private long id;
private String name;
private long id;
private String name;
public Company() {
super();
}
public Company() {
super();
}
public Company(final long id, final String name) {
this.id = id;
this.name = name;
}
public Company(final long id, final String name) {
this.id = id;
this.name = name;
}
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setName(final String name) {
this.name = name;
}
public void setName(final String name) {
this.name = name;
}
public long getId() {
return id;
}
public long getId() {
return id;
}
public void setId(final long id) {
this.id = id;
}
public void setId(final long id) {
this.id = id;
}
@Override
public String toString() {
return "Company [id=" + id + ", name=" + name + "]";
}
@Override
public String toString() {
return "Company [id=" + id + ", name=" + name + "]";
}
}

File diff suppressed because it is too large Load Diff