org.hisp.dhis.util.IdentifiableObjectUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dhis2-java-client Show documentation
Show all versions of dhis2-java-client Show documentation
DHIS 2 API client for Java.
package org.hisp.dhis.util;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.hisp.dhis.model.IdentifiableObject;
@NoArgsConstructor( access = AccessLevel.PRIVATE )
public class IdentifiableObjectUtils
{
/**
* Returns a list of object identifiers.
*
* @param objects the list of {@link IdentifiableObject}.
* @return a list of object identifiers.
*/
public List getIds( Collection objects )
{
return objects.stream()
.filter( Objects::nonNull )
.map( IdentifiableObject::getId )
.collect( Collectors.toList() );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy