Advertisement
MadMax1028

Kotlin Controller 2 decompiled

Aug 26th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.59 KB | None | 0 0
  1. @RestController
  2. @RequestMapping({"/person"})
  3. @Metadata(
  4.    mv = {1, 1, 2},
  5.    bv = {1, 0, 1},
  6.    k = 1,
  7.    d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\b\u0005\b\u0003\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0012\u0010\u0005\u001a\u00020\u00062\b\b\u0001\u0010\u0007\u001a\u00020\bH\u0007J,\u0010\t\u001a&\u0012\f\u0012\n \f*\u0004\u0018\u00010\u000b0\u000b \f*\u0012\u0012\f\u0012\n \f*\u0004\u0018\u00010\u000b0\u000b\u0018\u00010\r0\nH\u0007J\b\u0010\u000e\u001a\u00020\u0001H\u0007J\u001a\u0010\u000f\u001a\n \f*\u0004\u0018\u00010\u000b0\u000b2\b\b\u0001\u0010\u0007\u001a\u00020\bH\u0007J\u001a\u0010\u0010\u001a\n \f*\u0004\u0018\u00010\u000b0\u000b2\b\b\u0001\u0010\u0011\u001a\u00020\u000bH\u0007R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0012"},
  8.    d2 = {"Ldemo/controllers/PersonController;", "", "personRepository", "Ldemo/repository/PersonRepository;", "(Ldemo/repository/PersonRepository;)V", "delete", "", "id", "", "findAll", "", "Ldemo/model/Person;", "kotlin.jvm.PlatformType", "", "findAll2", "findOne", "save", "person", "kotlin-spring_main"}
  9. )
  10. final class PersonController {
  11.    private final PersonRepository personRepository;
  12.  
  13.    @GetMapping({"/{id}"})
  14.    public final Person findOne(@PathVariable long id) {
  15.       return (Person)this.personRepository.findOne(Long.valueOf(id));
  16.    }
  17.  
  18.    @GetMapping
  19.    public final List findAll() {
  20.       return this.personRepository.findAll();
  21.    }
  22.  
  23.    @GetMapping({"/customFindAll"})
  24.    @NotNull
  25.    public final Object findAll2() {
  26.       return new Object() {
  27.          private final List persons;
  28.  
  29.          public final List getPersons() {
  30.             return this.persons;
  31.          }
  32.  
  33.          {
  34.             this.persons = PersonController.this.personRepository.findAll();
  35.          }
  36.       };
  37.    }
  38.  
  39.    @PostMapping
  40.    public final Person save(@RequestBody @NotNull Person person) {
  41.       Intrinsics.checkParameterIsNotNull(person, "person");
  42.       return (Person)this.personRepository.save(person);
  43.    }
  44.  
  45.    @DeleteMapping({"/{id}"})
  46.    public final void delete(@PathVariable long id) {
  47.       this.personRepository.delete(Long.valueOf(id));
  48.    }
  49.  
  50.    public PersonController(@NotNull PersonRepository personRepository) {
  51.       Intrinsics.checkParameterIsNotNull(personRepository, "personRepository");
  52.       super();
  53.       this.personRepository = personRepository;
  54.    }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement