com.elastisys.scale.cloudpool.api.types

## Class Machine.Builder

- java.lang.Object
- - com.elastisys.scale.cloudpool.api.types.Machine.Builder

Enclosing class:
  Machine

    public static class Machine.Builder
    extends Object

A builder for creating `Machine` instances.

### Method Summary

All Methods Instance Methods Concrete Methods
`Machine` `build()` Creates a new `Machine` instance from the parameters passed thus far to the `Machine.Builder`.
`Machine.Builder` `cloudProvider(String cloudProvider)` The name of the cloud provider that this `Machine` originates from.
`Machine.Builder` `id(String id)` Sets the identifier for the `Machine` being built.
`Machine.Builder` `launchTime(org.joda.time.DateTime launchTime)` Sets the launchTime for the `Machine` being built.
`Machine.Builder` `machineSize(String machineSize)` The size (or type) of the `Machine`.
`Machine.Builder` `machineState(MachineState machineState)` Sets the `MachineState` for the `Machine` being built.
`Machine.Builder` `membershipStatus(MembershipStatus membershipStatus)` Sets the `MembershipStatus` for the `Machine` being built.
`Machine.Builder` `metadata(com.google.gson.JsonElement metadata)` Sets the meta data for the `Machine` being built.
`Machine.Builder` `privateIp(String privateIp)` Adds a single private IP address for the `Machine` being built.
`Machine.Builder` `privateIps(Collection<String> privateIps)` Adds several private IP address for the `Machine` being built.
`Machine.Builder` `publicIp(String publicIp)` Adds a single public IP address for the `Machine` being built.
`Machine.Builder` `publicIps(Collection<String> publicIps)` Adds several public IP address for the `Machine` being built.
`Machine.Builder` `region(String region)` The name of the cloud region/zone/data center where this machine is located.
`Machine.Builder` `requestTime(org.joda.time.DateTime requestTime)` Sets the requestTime for the `Machine` being built.
`Machine.Builder` `serviceState(ServiceState serviceState)` Sets the `ServiceState` for the `Machine` being built.

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

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

### Method Detail

#### build

    public Machine build()

Creates a new `Machine` instance from the parameters passed thus far to the `Machine.Builder`.

Returns:

#### id

    public Machine.Builder id(String id)

Sets the identifier for the `Machine` being built. Required attribute.

Parameters:
  `id` -
Returns:

#### machineState

    public Machine.Builder machineState(MachineState machineState)

Sets the `MachineState` for the `Machine` being built. Required attribute.

Parameters:
  `machineState` -
Returns:

#### cloudProvider

    public Machine.Builder cloudProvider(String cloudProvider)

The name of the cloud provider that this `Machine` originates from. Required attribute. For example, `AWS-EC2`.

Parameters:
  `cloudProvider` -
Returns:

#### region

    public Machine.Builder region(String region)

The name of the cloud region/zone/data center where this machine is located. Required attribute. For example, `us-east-1`.

Parameters:
  `region` -
Returns:

#### machineSize

    public Machine.Builder machineSize(String machineSize)

The size (or type) of the `Machine`. Required attribute. For example, `m1.medium` for an Amazon EC2 `CloudPool`.

Parameters:
  `machineSize` -
Returns:

#### serviceState

    public Machine.Builder serviceState(ServiceState serviceState)

Sets the `ServiceState` for the `Machine` being built. Default: `ServiceState.UNKNOWN`.

Parameters:
  `serviceState` -
Returns:

#### membershipStatus

    public Machine.Builder membershipStatus(MembershipStatus membershipStatus)

Sets the `MembershipStatus` for the `Machine` being built. Default: `MembershipStatus.defaultStatus()`.

Parameters:
  `membershipStatus` -
Returns:

#### launchTime

    public Machine.Builder launchTime(org.joda.time.DateTime launchTime)

Sets the launchTime for the `Machine` being built. Default: `null`.

Parameters:
  `launchTime` - Launch time. May be `null`.
Returns:

#### requestTime

    public Machine.Builder requestTime(org.joda.time.DateTime requestTime)

Sets the requestTime for the `Machine` being built. Default: `null`.

Parameters:
  `requestTime` - Request time. May be `null`.
Returns:

#### publicIp

    public Machine.Builder publicIp(String publicIp)

Adds a single public IP address for the `Machine` being built.

Parameters:
  `publicIp` -
Returns:

#### publicIps

    public Machine.Builder publicIps(Collection<String> publicIps)

Adds several public IP address for the `Machine` being built.

Parameters:
  `publicIps` -
Returns:

#### privateIp

    public Machine.Builder privateIp(String privateIp)

Adds a single private IP address for the `Machine` being built.

Parameters:
  `privateIp` -
Returns:

#### privateIps

    public Machine.Builder privateIps(Collection<String> privateIps)

Adds several private IP address for the `Machine` being built.

Parameters:
  `privateIps` -
Returns:

#### metadata

    public Machine.Builder metadata(com.google.gson.JsonElement metadata)

Sets the meta data for the `Machine` being built. Default: `null`.

Parameters:
  `metadata` - Meta data. May be `null`.
Returns: