All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openstack4j.openstack.common.ListResult Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
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