org.hisp.dhis.util.ListBuilder 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.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class ListBuilder
{
private final List list;
public ListBuilder()
{
list = new ArrayList<>();
}
public final ListBuilder addAll( List items )
{
this.list.addAll( items );
return this;
}
@SafeVarargs
public final ListBuilder add( T... items )
{
this.list.addAll( Arrays.asList( items ) );
return this;
}
public final ListBuilder add( T item )
{
this.list.add( item );
return this;
}
public List build()
{
return Collections.unmodifiableList( list );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy