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

io.fabric8.docker.client.DockerStreamData Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
package io.fabric8.docker.client;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

public interface DockerStreamData {

  StreamType streamType();

  int size();

  byte[] payload();

  enum StreamType {
    STDIN(0),
    STDOUT(1),
    STDERR(2);

    private static final Map lookup = new HashMap<>(3);

    static {
      for(StreamType s : EnumSet.allOf(StreamType.class)) {
        lookup.put(s.value, s);
      }
    }

    private final int value;

    StreamType(int streamType) {
      this.value = streamType;
    }

    public static StreamType lookup(int streamType) {
      StreamType type = lookup.get(streamType);
      if (type == null) {
        throw new IllegalArgumentException("Invalid stream type value: " + streamType);
      }
      return type;
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy