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 classGeneric preference object.static enum -
Method Summary
Modifier and TypeMethodDescriptionGets the value of theurlparameter of the preferenceodata.callbackornullif not set or the URI is not valid.Gets the value of the preferenceodata.maxpagesizeornullif not set or an invalid value has been set.getPreference(String name) Gets named preference.Gets the value of the preferencereturnornullif not set or the value is not valid.getWait()Gets the value of the preferencewaitornullif not set or the value is not valid.booleanWhether the preferenceodata.allow-entityreferenceshas been set.booleanWhether the preferenceodata.continue-on-errorhas been set.booleanWhether the preferencerespond-asynchas been set.booleanWhether the preferenceodata.track-changeshas been set.
-
Method Details
-
getPreference
Gets named preference. Names are case insensitive.- Parameters:
name- name of the preference- Returns:
Preferences.Preferenceornullif no such preference has been set
-
hasAllowEntityReferences
boolean hasAllowEntityReferences()Whether the preferenceodata.allow-entityreferenceshas been set. -
getCallback
URI getCallback()Gets the value of theurlparameter of the preferenceodata.callbackornullif not set or the URI is not valid.- Returns:
- the callback URI
-
hasContinueOnError
boolean hasContinueOnError()Whether the preferenceodata.continue-on-errorhas been set. -
getMaxPageSize
Integer getMaxPageSize()Gets the value of the preferenceodata.maxpagesizeornullif not set or an invalid value has been set.- Returns:
- the page size for server-driven paging
-
hasTrackChanges
boolean hasTrackChanges()Whether the preferenceodata.track-changeshas been set. -
getReturn
Preferences.Return getReturn()Gets the value of the preferencereturnornullif not set or the value is not valid. -
hasRespondAsync
boolean hasRespondAsync()Whether the preferencerespond-asynchas been set. -
getWait
Integer getWait()Gets the value of the preferencewaitornullif 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
-