Package org.smoodi.annotation.array
Annotation Interface NotEmptyArray
@Target({METHOD,PARAMETER,FIELD,LOCAL_VARIABLE})
@Retention(CLASS)
@Documented
public @interface NotEmptyArray
비어있지 않은 Collection 혹은 Array임을 표시.
아래의 경우, 반환값인 Collection이 비어있을 땐 null을 반환하므로, 비어있지 않은 반환값임이 보장됨.
@NotEmptyArray
@Nullable
publicList<String> getNames() {
if (this.names.isEmpty()) {
return null;
}
return this.names;
};
- Since:
- v1.1.0