private ClientIdentifier(final Client client, final CodeValue documentType,
final String documentKey, final LocalDate validity,
final String description) {
this.client = client;
this.documentType = documentType;
this.documentKey = StringUtils.defaultIfEmpty(documentKey, null);
this.validity = LocaleUtils.defaultIfEmpty(validity,null); // I am confused in this part
this.description = StringUtils.defaultIfEmpty(description, null);
}
我正在通过LocalDate,但不知道用于检查defualtIfEmpty的实用程序
答案 0 :(得分:0)
要为任何类型提供默认值,您可以使用例如来自Apache Commons的ObjectUtils.firstNonNull(T...)或来自Guava的MoreObjects.firstNonNull(T,T)。