ca.gc.aafc.dina.dto.ResourceNameIdentifierRequestDto Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dina-base-api Show documentation
Show all versions of dina-base-api Show documentation
Base DINA API package for Java built on SpringBoot and Crnk
The newest version!
package ca.gc.aafc.dina.dto;
import java.util.List;
import lombok.Builder;
import lombok.Getter;
import lombok.Singular;
import org.apache.commons.collections.CollectionUtils;
/**
* Identifies a request for resource identifier by name.
* name may not be unique depending on the implementation.
* group is optional depending on the implementation.
*/
@Builder
@Getter
public class ResourceNameIdentifierRequestDto {
private String type;
private String group;
@Singular
private List names;
public boolean isSingleName() {
return CollectionUtils.isNotEmpty(names) && names.size() == 1;
}
public String getSingleName() {
if (isSingleName()) {
return names.get(0);
}
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy