Interface Preferences
public interface Preferences
Provides access methods to the preferences set in Prefer HTTP request headers
as described in RFC 7240.
Preferences defined in the OData standard can be accessed with named methods.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Generic preference object.static enum
-
Method Summary
Modifier and TypeMethodDescriptionGets the value of theurl
parameter of the preferenceodata.callback
ornull
if not set or the URI is not valid.Gets the value of the preferenceodata.maxpagesize
ornull
if not set or an invalid value has been set.getPreference
(String name) Gets named preference.Gets the value of the preferencereturn
ornull
if not set or the value is not valid.getWait()
Gets the value of the preferencewait
ornull
if not set or the value is not valid.boolean
Whether the preferenceodata.allow-entityreferences
has been set.boolean
Whether the preferenceodata.continue-on-error
has been set.boolean
Whether the preferencerespond-async
has been set.boolean
Whether the preferenceodata.track-changes
has been set.
-
Method Details
-
getPreference
Gets named preference. Names are case insensitive.- Parameters:
name
- name of the preference- Returns:
Preferences.Preference
ornull
if no such preference has been set
-
hasAllowEntityReferences
boolean hasAllowEntityReferences()Whether the preferenceodata.allow-entityreferences
has been set. -
getCallback
URI getCallback()Gets the value of theurl
parameter of the preferenceodata.callback
ornull
if not set or the URI is not valid.- Returns:
- the callback URI
-
hasContinueOnError
boolean hasContinueOnError()Whether the preferenceodata.continue-on-error
has been set. -
getMaxPageSize
Integer getMaxPageSize()Gets the value of the preferenceodata.maxpagesize
ornull
if not set or an invalid value has been set.- Returns:
- the page size for server-driven paging
-
hasTrackChanges
boolean hasTrackChanges()Whether the preferenceodata.track-changes
has been set. -
getReturn
Preferences.Return getReturn()Gets the value of the preferencereturn
ornull
if not set or the value is not valid. -
hasRespondAsync
boolean hasRespondAsync()Whether the preferencerespond-async
has been set. -
getWait
Integer getWait()Gets the value of the preferencewait
ornull
if not set or the value is not valid.- Returns:
- the number of seconds the client is prepared to wait for the service to process the request synchronously
-