org.openstack4j.openstack.common.ListResult Maven / Gradle / Ivy
package org.openstack4j.openstack.common;
import java.util.Collections;
import java.util.List;
import org.openstack4j.core.transport.ListType;
import org.openstack4j.model.ModelEntity;
/**
* A List result which wrappers a JSON Array
*
* @param the generic type
*/
public abstract class ListResult implements ModelEntity, ListType {
private static final long serialVersionUID = 1L;
protected abstract List value();
public List getList() {
if (value() == null)
return Collections.emptyList();
return value();
}
public T first() {
return value().isEmpty() ? null : value().get(0);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy