Class ResourceResult<T extends Resource>


  • public class ResourceResult<T extends Resource>
    extends java.lang.Object
    The base result wrapper used to represent a resource being returned from a persistence interaction. Instances are immutable and can be constructed via new ResourceResult.Builder<T>().
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • from

        public static ResourceResult<? extends Resource> from​(Resource resource)
        Convenience method to convert a Resource value to a ResourceResult, which is useful for unit-tests
        Type Parameters:
        T -
        Parameters:
        resource - with a valid meta field
        Returns:
      • toResourceList

        public static java.util.List<? extends Resource> toResourceList​(java.util.List<ResourceResult<? extends Resource>> resourceResults)
        Convenience function to convert a list of ResourceResults to a list of Resources which are not null
        Parameters:
        resourceResults -
        Returns:
      • isDeleted

        public boolean isDeleted()
        Whether or not the resource is deleted
        Returns:
        whether the resource is deleted
      • getResource

        public T getResource()
        The resource resulting from the interaction
        Returns:
        An immutable object of type Resource.
      • getResourceTypeName

        public java.lang.String getResourceTypeName()
        Returns:
        the resourceTypeName
      • getLogicalId

        public java.lang.String getLogicalId()
        Returns:
        the logicalId
      • getVersion

        public int getVersion()
        Returns:
        the version
      • getLastUpdated

        public java.time.Instant getLastUpdated()
        Returns:
        the lastUpdated