課金額に負数を入力できないようにするjavaを教えてください。
package com.example.billing.Controller;
import com.example.billing.Data.;
import com.example.billing.Request.;
import com.example.billing.Service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@Controller
public class EditController {
@Autowired
BillingService BillingService;
@GetMapping(value = "/edit/{id}")
public String edit(@PathVariable("id") final Integer id, Model model) {
Billing Billing = BillingService.findById(id);
model.addAttribute("title", "編集画面");
model.addAttribute("billing", Billing);
return "edit";
}
@PostMapping(value = "/update")
public String update(@ModelAttribute final BillingEditRequest BillingEditRequest,
RedirectAttributes RedirectAttributes, Model model) {
BillingService.edit(BillingEditRequest);
RedirectAttributes.addAttribute("app", BillingEditRequest.getApplication());
return "redirect:/billinghistory/{app}";
}
}