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

com.github.narcissujsk.openstackjsk.openstack.compute.domain.NovaFloatingIPPools Maven / Gradle / Ivy

The newest version!
package com.github.narcissujsk.openstackjsk.openstack.compute.domain;

import java.util.Collections;
import java.util.List;

import com.github.narcissujsk.openstackjsk.openstack.common.ListResult;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Function;
import com.google.common.collect.Lists;

/**
 * Maps to the OpenStack Floating IP Pool specification and used internally to retrieve the list of pool names
 * 
 * @author Jeremy Unruh
 *
 */
public class NovaFloatingIPPools extends ListResult {

	private static final long serialVersionUID = 1L;

	@JsonProperty("floating_ip_pools")
	private List values;
	
	/**
	 * {@inheritDoc}
	 */
	@Override
	protected List value() {
		if (values != null)
			return Lists.transform(values, WrapperToStringFunc.instance);
		return Collections.emptyList();
	}

	static final class Wrapper {
		@JsonProperty("name")
		String name;
	}
	
	private static class WrapperToStringFunc implements Function {

		static final WrapperToStringFunc instance = new WrapperToStringFunc();
		
		@Override
		public String apply(Wrapper input) {
			return input.name;
		}
		
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy