Package net.webpdf.wsclient.session
Enum DataFormat
- java.lang.Object
-
- java.lang.Enum<DataFormat>
-
- net.webpdf.wsclient.session.DataFormat
-
- All Implemented Interfaces:
Serializable,Comparable<DataFormat>
public enum DataFormat extends Enum<DataFormat>
DataFormatenumerates all known formats for aSession´s data transfer objects.- See Also:
XML,JSON,OCTET_STREAM,PLAIN,ANY
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANYunspecified file format.JSONJavaScript Object NotationOCTET_STREAMAn unspecified binary stream.PLAINA plain text.XMLExtensible Markup Language
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull StringgetMimeType()Return the MIME-type represented by thisDataFormat.booleanmatches(@Nullable String mimeType)Returnstrueshould the given MIME-type match the selectedDataFormat.StringtoString()Returns aStringrepresentation of the selectedDataFormat.static DataFormatvalueOf(String name)Returns the enum constant of this type with the specified name.static DataFormat[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
XML
public static final DataFormat XML
Extensible Markup Language
-
JSON
public static final DataFormat JSON
JavaScript Object Notation
-
OCTET_STREAM
public static final DataFormat OCTET_STREAM
An unspecified binary stream.
-
PLAIN
public static final DataFormat PLAIN
A plain text.
-
ANY
public static final DataFormat ANY
unspecified file format.
-
-
Method Detail
-
values
public static DataFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DataFormat c : DataFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DataFormat valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getMimeType
@NotNull public @NotNull String getMimeType()
Return the MIME-type represented by thisDataFormat.- Returns:
- The MIME-type represented by this
DataFormat.
-
matches
public boolean matches(@Nullable @Nullable String mimeType)Returnstrueshould the given MIME-type match the selectedDataFormat.- Parameters:
mimeType- The MIME-type to check.- Returns:
trueshould the given MIME-type match the selectedDataFormat.
-
toString
public String toString()
Returns aStringrepresentation of the selectedDataFormat.- Overrides:
toStringin classEnum<DataFormat>- Returns:
- A
Stringrepresentation of the selectedDataFormat.
-
-