Class MethodOutcome

    • Constructor Detail

      • MethodOutcome

        public MethodOutcome​(IIdType theId,
                             Boolean theCreated)
        Constructor
        Parameters:
        theId - The ID of the created/updated resource
        theCreated - If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist.
      • MethodOutcome

        public MethodOutcome​(IIdType theId,
                             IBaseOperationOutcome theBaseOperationOutcome)
        Constructor
        Parameters:
        theId - The ID of the created/updated resource
        theBaseOperationOutcome - The operation outcome to return with the response (or null for none)
      • MethodOutcome

        public MethodOutcome​(IIdType theId,
                             IBaseOperationOutcome theBaseOperationOutcome,
                             Boolean theCreated)
        Constructor
        Parameters:
        theId - The ID of the created/updated resource
        theBaseOperationOutcome - The operation outcome to return with the response (or null for none)
        theCreated - If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist.
      • MethodOutcome

        public MethodOutcome​(IIdType theId)
        Constructor
        Parameters:
        theId - The ID of the created/updated resource
      • MethodOutcome

        public MethodOutcome​(IBaseOperationOutcome theOperationOutcome)
        Constructor
        Parameters:
        theOperationOutcome - The operation outcome resource to return
    • Method Detail

      • getCreated

        public Boolean getCreated()
        This will be set to Boolean.TRUE for instance of MethodOutcome which are returned to client instances, if the server has responded with an HTTP 201 Created.
      • setCreated

        public MethodOutcome setCreated​(Boolean theCreated)
        If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist.

        Users of HAPI should only interact with this method in Server applications

        Parameters:
        theCreated - If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist.
        Returns:
        Returns a reference to this for easy method chaining
      • setId

        public MethodOutcome setId​(IIdType theId)
        Parameters:
        theId - The ID of the created/updated resource
        Returns:
        Returns a reference to this for easy method chaining
      • getResource

        public IBaseResource getResource()
        From a client response: If the method returned an actual resource body (e.g. a create/update with "Prefer: return=representation") this field will be populated with the resource itself.
      • registerResourceViewCallback

        public void registerResourceViewCallback​(Runnable theCallback)
        Registers a callback to be invoked before the resource in this object gets returned to the client. Note that this is an experimental API and may change.
        Parameters:
        theCallback - The callback
        Since:
        4.0.0