com.elastisys.scale.cloudpool.openstack.functions

## Class ServerToMachine

- java.lang.Object
- - com.elastisys.scale.cloudpool.openstack.functions.ServerToMachine

All Implemented Interfaces:
  com.google.common.base.Function<org.openstack4j.model.compute.Server,Machine>

    public class ServerToMachine
    extends Object
    implements com.google.common.base.Function<org.openstack4j.model.compute.Server,Machine>

Translates a `Server` from the OpenStack API to its `Machine` counterpart.

### Constructor Summary

Constructors
Constructor and Description
`ServerToMachine(String cloudProvider, String region)` Constructs a `ServerToMachine` conversion `Function`.

### Method Summary

All Methods Instance Methods Concrete Methods
`Machine` `apply(org.openstack4j.model.compute.Server server)` Converts a `Server` from the OpenStack API to its `Machine` representation.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface com.google.common.base.Function

`equals`

### Constructor Detail

#### ServerToMachine

    public ServerToMachine(String cloudProvider,
                           String region)

Constructs a `ServerToMachine` conversion `Function`.

Parameters:
  `cloudProvider` - The name of the cloud provider (for example, "OpenStack", "RackSpace", "CityCloud").
  `The` - region being connected to. For example, `Kna1` or `LON`.

### Method Detail

#### apply

    public Machine apply(org.openstack4j.model.compute.Server server)

Converts a `Server` from the OpenStack API to its `Machine` representation.

Specified by:
  `apply` in interface `com.google.common.base.Function<org.openstack4j.model.compute.Server,Machine>`
Parameters:
  `server` - The `Server` representation.
Returns:
  The corresponding `Machine` representation.