Class Prefer

    • Constructor Detail

      • Prefer

        public Prefer​(String preference,
                      List<String> include,
                      List<String> omit,
                      Set<String> params,
                      String handling)
        Create a Prefer header representation.
        Parameters:
        preference - the preference value
        include - a list of include values
        omit - a list of omit values
        params - single-valued parameters
        handling - the handling value
    • Method Detail

      • valueOf

        public static Prefer valueOf​(String value)
        Create a Prefer header representation from a header string.
        Parameters:
        value - the header value
        Returns:
        a Prefer object or null on an invalid string
      • getPreference

        public Optional<String> getPreference()
        Get the preferred return type.
        Returns:
        the preferred return type
      • getHandling

        public Optional<String> getHandling()
        Get the handling type.
        Returns:
        the preferred handling type
      • getRespondAsync

        public boolean getRespondAsync()
        Identify whether the respond-async parameter was set.
        Returns:
        true if the respond-async parameter was set; false otherwise
      • getInclude

        public List<String> getInclude()
        Get the preferred include IRIs.
        Returns:
        the list of IRIs to be included in the representation
      • getOmit

        public List<String> getOmit()
        Get the preferred omit IRIs.
        Returns:
        the list of IRIs to be omitted from the representation
      • ofInclude

        public static Prefer ofInclude​(String... includes)
        Build a Prefer object with a set of included IRIs.
        Parameters:
        includes - the IRIs to include
        Returns:
        the Prefer object
      • ofOmit

        public static Prefer ofOmit​(String... omits)
        Build a Prefer object with a set of omitted IRIs.
        Parameters:
        omits - the IRIs to omit
        Returns:
        the Prefer object