Class MediaType

java.lang.Object
org.yamcs.http.MediaType

public final class MediaType extends Object
Syntactic sugar around a media type string. Contains predefined ones, but is open-ended for when we support dynamic rest handlers better.
  • Field Details

    • OCTET_STREAM

      public static final MediaType OCTET_STREAM
    • CSV

      public static final MediaType CSV
    • JSON

      public static final MediaType JSON
    • PROTOBUF

      public static final MediaType PROTOBUF
    • PLAIN_TEXT

      public static final MediaType PLAIN_TEXT
    • ANY

      public static final MediaType ANY
  • Method Details

    • is

      public boolean is(String typeString)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • from

      public static MediaType from(String typeString)
      Returns one of the static members (OCTET_STREAM, CSV, etc) if this is a known type or a new object if the type is unknown.
      Parameters:
      typeString -
      Returns:
      the MediaType object corresponding to the type string