@GetMapping("/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/commits") public List<CommitDTO> find(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @Valid @PositiveOrZero(message = "page should be positive or 0") @RequestParam(defaultValue = "0") int page, @Valid @Positive(message = "size should be positive number") @RequestParam(defaultValue = "10") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return commitService.find(appId, Env.valueOf(env), clusterName, namespaceName, page, size); } }
@GetMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all") public List<ReleaseBO> findAllReleases(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @Valid @PositiveOrZero(message = "page should be positive or 0") @RequestParam(defaultValue = "0") int page, @Valid @Positive(message = "size should be positive number") @RequestParam(defaultValue = "5") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseService.findAllReleases(appId, Env.valueOf(env), clusterName, namespaceName, page, size); }
@GetMapping(value = "/apps/{appId}/envs/{env}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active") public List<ReleaseDTO> findActiveReleases(@PathVariable String appId, @PathVariable String env, @PathVariable String clusterName, @PathVariable String namespaceName, @Valid @PositiveOrZero(message = "page should be positive or 0") @RequestParam(defaultValue = "0") int page, @Valid @Positive(message = "size should be positive number") @RequestParam(defaultValue = "5") int size) { if (permissionValidator.shouldHideConfigToCurrentUser(appId, env, namespaceName)) { return Collections.emptyList(); } return releaseService.findActiveReleases(appId, Env.valueOf(env), clusterName, namespaceName, page, size); }
private static class PositiveEntity { @Positive private BigDecimal bigDecimal; @Positive private BigInteger bigInteger; @Positive private byte bytePrimitive; @Positive private short shortPrimitive; @Positive private int intPrimitive; @Positive private long longPrimitive; @Positive private double doublePrimitive; @Positive private float floatPrimitive; @Positive private Byte byteObject; @Positive private Short shortObject; @Positive private Integer intObject; @Positive private Long longObject; @Positive private Double doubleObject; @Positive private Float floatObject; }
@GetMapping public ResponseEntity<List<User>> findAll( @Valid @Positive(message = "Page number should be a positive number") @RequestParam(required = false, defaultValue = "1") int page, @Valid @Positive(message = "Page size should be a positive number") @RequestParam(required = false, defaultValue = "10") int size) { HttpHeaders headers = new HttpHeaders(); Page<User> users = repository.findAll(PageRequest.of(page, size)); headers.add("X-Users-Total", Long.toString(users.getTotalElements())); return new ResponseEntity<>(users.getContent(), headers, HttpStatus.OK); }
@Builder @NoArgsConstructor @AllArgsConstructor public class RedisStoreOptions implements Options { @NotEmpty public String host; @Positive public int port; @PositiveOrZero public int batchSize; /** Timeout in milliseconds * */ @PositiveOrZero public int timeout; }
private String notEmptyHibernateValidator; @Positive private int positive;
public class SlaEditionVo extends DescribedBean<Integer> { @Positive private int subscription;
private String mobsimMode = TransportMode.car;// used for events throwing and thus calculating travel times, etc. @Positive @Max(1) private double travelTimeEstimationAlpha = 0.05; // [-], 1 ==> TTs from the last iteration only