Class AbstractControllable<T,​ID>

  • All Implemented Interfaces:
    io.easywalk.simply.specification.SimplySpec<T,​ID>

    public abstract class AbstractControllable<T,​ID>
    extends java.lang.Object
    implements io.easywalk.simply.specification.SimplySpec<T,​ID>
    • Constructor Detail

      • AbstractControllable

        public AbstractControllable()
    • Method Detail

      • create

        @PostMapping
        @ResponseStatus(CREATED)
        public T create​(@Valid @RequestBody
                        T createForm)
                 throws java.lang.Throwable
        Specified by:
        create in interface io.easywalk.simply.specification.SimplySpec<T,​ID>
        Throws:
        java.lang.Throwable
      • replaceById

        @PutMapping("/{id}")
        public T replaceById​(@PathVariable
                             ID id,
                             @RequestBody @Valid
                             T replace)
                      throws java.lang.Throwable
        Specified by:
        replaceById in interface io.easywalk.simply.specification.SimplySpec<T,​ID>
        Throws:
        java.lang.Throwable
      • updateById

        @PatchMapping("/{id}")
        public T updateById​(@PathVariable
                            ID id,
                            @RequestBody
                            java.util.Map<java.lang.String,​java.lang.Object> fields)
                     throws java.lang.Throwable
        Specified by:
        updateById in interface io.easywalk.simply.specification.SimplySpec<T,​ID>
        Throws:
        java.lang.Throwable
      • get

        @GetMapping("/{id}")
        public T get​(@PathVariable
                     ID id)
              throws java.lang.Throwable
        Specified by:
        get in interface io.easywalk.simply.specification.SimplySpec<T,​ID>
        Throws:
        java.lang.Throwable
      • getAll

        @GetMapping
        public java.util.List<T> getAll()
        Specified by:
        getAll in interface io.easywalk.simply.specification.SimplySpec<T,​ID>
      • deleteById

        @DeleteMapping("/{id}")
        @ResponseStatus(NO_CONTENT)
        public void deleteById​(@PathVariable
                               ID id)
                        throws java.lang.Throwable
        Specified by:
        deleteById in interface io.easywalk.simply.specification.SimplySpec<T,​ID>
        Throws:
        java.lang.Throwable
      • delete

        public void delete​(T entity)
                    throws java.lang.Throwable
        Specified by:
        delete in interface io.easywalk.simply.specification.SimplySpec<T,​ID>
        Throws:
        java.lang.Throwable