Class PreferencesImpl

java.lang.Object
org.apache.olingo.server.core.prefer.PreferencesImpl
All Implemented Interfaces:
Preferences

public class PreferencesImpl extends Object implements Preferences
Provides access methods to the preferences set in the Prefer HTTP request header as described in RFC 7240. Preferences defined in the OData standard can be accessed with named methods.
  • Constructor Details

  • Method Details

    • getPreference

      public Preferences.Preference getPreference(String name)
      Description copied from interface: Preferences
      Gets named preference. Names are case insensitive.
      Specified by:
      getPreference in interface Preferences
      Parameters:
      name - name of the preference
      Returns:
      Preferences.Preference or null if no such preference has been set
    • hasAllowEntityReferences

      public boolean hasAllowEntityReferences()
      Description copied from interface: Preferences
      Whether the preference odata.allow-entityreferences has been set.
      Specified by:
      hasAllowEntityReferences in interface Preferences
    • getCallback

      public URI getCallback()
      Description copied from interface: Preferences
      Gets the value of the url parameter of the preference odata.callback or null if not set or the URI is not valid.
      Specified by:
      getCallback in interface Preferences
      Returns:
      the callback URI
    • hasContinueOnError

      public boolean hasContinueOnError()
      Description copied from interface: Preferences
      Whether the preference odata.continue-on-error has been set.
      Specified by:
      hasContinueOnError in interface Preferences
    • getMaxPageSize

      public Integer getMaxPageSize()
      Description copied from interface: Preferences
      Gets the value of the preference odata.maxpagesize or null if not set or an invalid value has been set.
      Specified by:
      getMaxPageSize in interface Preferences
      Returns:
      the page size for server-driven paging
    • hasTrackChanges

      public boolean hasTrackChanges()
      Description copied from interface: Preferences
      Whether the preference odata.track-changes has been set.
      Specified by:
      hasTrackChanges in interface Preferences
    • getReturn

      public Preferences.Return getReturn()
      Description copied from interface: Preferences
      Gets the value of the preference return or null if not set or the value is not valid.
      Specified by:
      getReturn in interface Preferences
    • hasRespondAsync

      public boolean hasRespondAsync()
      Description copied from interface: Preferences
      Whether the preference respond-async has been set.
      Specified by:
      hasRespondAsync in interface Preferences
    • getWait

      public Integer getWait()
      Description copied from interface: Preferences
      Gets the value of the preference wait or null if not set or the value is not valid.
      Specified by:
      getWait in interface Preferences
      Returns:
      the number of seconds the client is prepared to wait for the service to process the request synchronously