// Path: mesos-rxjava-util/src/main/java/com/mesosphere/mesos/rx/java/util/MessageCodec.java
// public interface MessageCodec<T> {
// 
//     /**
//      * Serialize the given {@code message} into an array of bytes.
//      *
//      * @param message the message to serialize
//      * @return the serialized message
//      */
//     @NotNull
//     byte[] encode(@NotNull final T message);
// 
//     /**
//      * Deserialize the given byte array into a message.
//      *
//      * @param bytes the bytes to deserialize
//      * @return the deserialized message
//      * @throws RuntimeException If an error occurs when decoding {@code bytes}. If a checked exception is possible
//      *                          it should be wrapped in a RuntimeException.
//      */
//     @NotNull
//     T decode(@NotNull final byte[] bytes);
// 
//     /**
//      * Deserialize the given byte array into a message.
//      *
//      * @param in The {@link InputStream} to deserialize the message from
//      * @return the deserialized message
//      * @throws RuntimeException If an error occurs when decoding {@code bytes}. If a checked exception is possible
//      *                          it should be wrapped in a RuntimeException.
//      */
//     @NotNull
//     T decode(@NotNull final InputStream in);
// 
//     /**
//      * Returns the <a target="_blank" href="https://en.wikipedia.org/wiki/Media_type">IANA media type</a> of the serialized message
//      * format handled by this object.
//      * <p>
//      * The value returned by this method will be used in the {@code Content-Type} and {@code Accept} headers for
//      * messages sent to and received from Mesos, respectively.
//      *
//      * @return the media type identifier
//      */
//     @NotNull
//     String mediaType();
// 
//     /**
//      * Renders the given {@code message} to informative, human-readable text.
//      * <p>
//      * The intent of this method is to allow messages to be easily read in program logs and while debugging.
//      *
//      * @param message the message to render
//      * @return the rendered message
//      */
//     @NotNull
//     String show(@NotNull final T message);
// 
// }
// 
// Path: mesos-rxjava-util/src/main/java/com/mesosphere/mesos/rx/java/util/UserAgentEntry.java
// public final class UserAgentEntry {
//     @NotNull
//     private final String name;
//     @NotNull
//     private final String version;
//     @Nullable
//     private final String details;
// 
//     public UserAgentEntry(@NotNull final String name, @NotNull final String version) {
//         this(name, version, null);
//     }
// 
//     public UserAgentEntry(@NotNull final String name, @NotNull final String version, @Nullable final String details) {
//         this.name = name;
//         this.version = version;
//         this.details = details;
//     }
// 
//     @NotNull
//     public String getName() {
//         return name;
//     }
// 
//     @NotNull
//     public String getVersion() {
//         return version;
//     }
// 
//     @Nullable
//     public String getDetails() {
//         return details;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         final UserAgentEntry that = (UserAgentEntry) o;
//         return Objects.equals(name, that.name) &&
//             Objects.equals(version, that.version) &&
//             Objects.equals(details, that.details);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(name, version, details);
//     }
// 
//     @Override
//     public String toString() {
//         if (details != null) {
//             return String.format("%s/%s (%s)", name, version, details);
//         } else {
//             return String.format("%s/%s", name, version);
//         }
//     }
// }
// 
// Path: mesos-rxjava-util/src/main/java/com/mesosphere/mesos/rx/java/util/Validations.java
// public static <T> T checkNotNull(@Nullable T ref) {
//     return checkNotNull(ref, null);
// }


import com.mesosphere.mesos.rx.java.util.MessageCodec;
import com.mesosphere.mesos.rx.java.util.UserAgentEntry;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import rx.BackpressureOverflow;
import rx.Observable;
import rx.functions.Action0;
import java.net.URI;
import java.util.Optional;
import java.util.function.Function;
import static com.mesosphere.mesos.rx.java.util.Validations.checkNotNull;
     * @return this builder (allowing for further chained calls)
     */
    @NotNull
    public MesosClientBuilder<Send, Receive> applicationUserAgentEntry(
        @NotNull final Function<Class<?>, UserAgentEntry> applicationUserAgentEntry
    ) {
        this.applicationUserAgentEntry = applicationUserAgentEntry;
        return this;
    }

    /**
     * Allows configuration of the codec used for the {@code Send} type.
     * @param sendCodec    {@link MessageCodec} for {@code Send} type
     * @return this builder (allowing for further chained calls)
     */
    @NotNull
    public MesosClientBuilder<Send, Receive> sendCodec(
        @NotNull final MessageCodec<Send> sendCodec
    ) {
        this.sendCodec = sendCodec;
        return this;
    }

    /**
     * Allows configuration of the codec used for the {@code Receive} type.
     * @param receiveCodec    {@link MessageCodec} for {@code Receive} type
     * @return this builder (allowing for further chained calls)
     */
    @NotNull
    public MesosClientBuilder<Send, Receive> receiveCodec(
// Path: mesos-rxjava-util/src/main/java/com/mesosphere/mesos/rx/java/util/MessageCodec.java
// public interface MessageCodec<T> {
// 
//     /**
//      * Serialize the given {@code message} into an array of bytes.
//      *
//      * @param message the message to serialize
//      * @return the serialized message
//      */
//     @NotNull
//     byte[] encode(@NotNull final T message);
// 
//     /**
//      * Deserialize the given byte array into a message.
//      *
//      * @param bytes the bytes to deserialize
//      * @return the deserialized message
//      * @throws RuntimeException If an error occurs when decoding {@code bytes}. If a checked exception is possible
//      *                          it should be wrapped in a RuntimeException.
//      */
//     @NotNull
//     T decode(@NotNull final byte[] bytes);
// 
//     /**
//      * Deserialize the given byte array into a message.
//      *
//      * @param in The {@link InputStream} to deserialize the message from
//      * @return the deserialized message
//      * @throws RuntimeException If an error occurs when decoding {@code bytes}. If a checked exception is possible
//      *                          it should be wrapped in a RuntimeException.
//      */
//     @NotNull
//     T decode(@NotNull final InputStream in);
// 
//     /**
//      * Returns the <a target="_blank" href="https://en.wikipedia.org/wiki/Media_type">IANA media type</a> of the serialized message
//      * format handled by this object.
//      * <p>
//      * The value returned by this method will be used in the {@code Content-Type} and {@code Accept} headers for
//      * messages sent to and received from Mesos, respectively.
//      *
//      * @return the media type identifier
//      */
//     @NotNull
//     String mediaType();
// 
//     /**
//      * Renders the given {@code message} to informative, human-readable text.
//      * <p>
//      * The intent of this method is to allow messages to be easily read in program logs and while debugging.
//      *
//      * @param message the message to render
//      * @return the rendered message
//      */
//     @NotNull
//     String show(@NotNull final T message);
// 
// }
// 
// Path: mesos-rxjava-util/src/main/java/com/mesosphere/mesos/rx/java/util/UserAgentEntry.java
// public final class UserAgentEntry {
//     @NotNull
//     private final String name;
//     @NotNull
//     private final String version;
//     @Nullable
//     private final String details;
// 
//     public UserAgentEntry(@NotNull final String name, @NotNull final String version) {
//         this(name, version, null);
//     }
// 
//     public UserAgentEntry(@NotNull final String name, @NotNull final String version, @Nullable final String details) {
//         this.name = name;
//         this.version = version;
//         this.details = details;
//     }
// 
//     @NotNull
//     public String getName() {
//         return name;
//     }
// 
//     @NotNull
//     public String getVersion() {
//         return version;
//     }
// 
//     @Nullable
//     public String getDetails() {
//         return details;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         final UserAgentEntry that = (UserAgentEntry) o;
//         return Objects.equals(name, that.name) &&
//             Objects.equals(version, that.version) &&
//             Objects.equals(details, that.details);
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(name, version, details);
//     }
// 
//     @Override
//     public String toString() {
//         if (details != null) {
//             return String.format("%s/%s (%s)", name, version, details);
//         } else {
//             return String.format("%s/%s", name, version);
//         }
//     }
// }
// 
// Path: mesos-rxjava-util/src/main/java/com/mesosphere/mesos/rx/java/util/Validations.java
// public static <T> T checkNotNull(@Nullable T ref) {
//     return checkNotNull(ref, null);
// }


// Path: mesos-rxjava-client/src/main/java/com/mesosphere/mesos/rx/java/MesosClientBuilder.java
import com.mesosphere.mesos.rx.java.util.MessageCodec;
import com.mesosphere.mesos.rx.java.util.UserAgentEntry;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import rx.BackpressureOverflow;
import rx.Observable;
import rx.functions.Action0;
import java.net.URI;
import java.util.Optional;
import java.util.function.Function;
import static com.mesosphere.mesos.rx.java.util.Validations.checkNotNull;

     * @return this builder (allowing for further chained calls)
     */
    @NotNull
    public MesosClientBuilder<Send, Receive> applicationUserAgentEntry(
        @NotNull final Function<Class<?>, UserAgentEntry> applicationUserAgentEntry
    ) {
        this.applicationUserAgentEntry = applicationUserAgentEntry;
        return this;
    }

    /**
     * Allows configuration of the codec used for the {@code Send} type.
     * @param sendCodec    {@link MessageCodec} for {@code Send} type
     * @return this builder (allowing for further chained calls)
     */
    @NotNull
    public MesosClientBuilder<Send, Receive> sendCodec(
        @NotNull final MessageCodec<Send> sendCodec
    ) {
        this.sendCodec = sendCodec;
        return this;
    }

    /**
     * Allows configuration of the codec used for the {@code Receive} type.
     * @param receiveCodec    {@link MessageCodec} for {@code Receive} type
     * @return this builder (allowing for further chained calls)
     */
    @NotNull
    public MesosClientBuilder<Send, Receive> receiveCodec(
        @NotNull final MessageCodec<Receive> receiveCodec