public class Prefer extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PREFER_HANDLING |
static String |
PREFER_INCLUDE |
static String |
PREFER_LENIENT |
static String |
PREFER_MINIMAL |
static String |
PREFER_OMIT |
static String |
PREFER_REPRESENTATION |
static String |
PREFER_RETURN |
static String |
PREFER_STRICT |
Constructor and Description |
---|
Prefer(String preference,
List<String> include,
List<String> omit,
Set<String> params,
String handling)
Create a Prefer header representation.
|
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getHandling()
Get the handling type.
|
List<String> |
getInclude()
Get the preferred include IRIs.
|
List<String> |
getOmit()
Get the preferred omit IRIs.
|
Optional<String> |
getPreference()
Get the preferred return type.
|
boolean |
getRespondAsync()
Identify whether the respond-async parameter was set.
|
static Prefer |
ofInclude(String... includes)
Build a Prefer object with a set of included IRIs.
|
static Prefer |
ofOmit(String... omits)
Build a Prefer object with a set of omitted IRIs.
|
String |
toString() |
static Prefer |
valueOf(String value)
Create a Prefer header representation from a header string.
|
public static final String PREFER_REPRESENTATION
public static final String PREFER_MINIMAL
public static final String PREFER_STRICT
public static final String PREFER_LENIENT
public static final String PREFER_RETURN
public static final String PREFER_INCLUDE
public static final String PREFER_OMIT
public static final String PREFER_HANDLING
public Prefer(String preference, List<String> include, List<String> omit, Set<String> params, String handling)
preference
- the preference valueinclude
- a list of include valuesomit
- a list of omit valuesparams
- single-valued parametershandling
- the handling valuepublic static Prefer valueOf(String value)
value
- the header valuepublic Optional<String> getPreference()
public Optional<String> getHandling()
public boolean getRespondAsync()
public List<String> getInclude()
public List<String> getOmit()
public static Prefer ofInclude(String... includes)
includes
- the IRIs to include