Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Custom @ interface and groups check

Shulou Source: shulou.com Published: 2022-06-03 06:26:15 11月23日 Update

1. Custom annotation

Extracted from: http://elim.iteye.com/blog/1812584

@ Target ({ElementType.FIELD, ElementType.METHOD})

@ Retention (RetentionPolicy.RUNTIME)

@ Constraint (validatedBy=MinValidator.class)

Public @ interface Min {

Int value () default 0

String message ()

Class [] groups () default {}

Class

Tags: Variables attributes age members types restrictions can be passed by name method reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info OPPO Reno MySQL NVidia Huawei