Class ContentReference


  • public class ContentReference
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ContentReference​(java.lang.String mediaType, java.util.List<Segment> segments, long ignored)
      Provide an all-args constructor including size, which is a field in graphql but not on the object
      ContentReference​(java.lang.String mediaType, Segment... segments)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getSize()
      Calculate size of all the segments
      void setSize​(long ignored)
      Empty method in place for object mappers trying to set the size from JSON
      ContentReference subreference​(long offset, long size)
      Returns a new ContentReference that is a copy of a portion of this ContentReference, at the given offset and size Handles piecing together the underlying segments properly
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContentReference

        public ContentReference​(java.lang.String mediaType,
                                Segment... segments)
      • ContentReference

        public ContentReference​(java.lang.String mediaType,
                                java.util.List<Segment> segments,
                                long ignored)
        Provide an all-args constructor including size, which is a field in graphql but not on the object
        Parameters:
        mediaType - mediaType
        segments - segments
        ignored - placeholder for size
    • Method Detail

      • setSize

        public void setSize​(long ignored)
        Empty method in place for object mappers trying to set the size from JSON
        Parameters:
        ignored - ignored field
      • getSize

        public long getSize()
        Calculate size of all the segments
        Returns:
        total size
      • subreference

        public ContentReference subreference​(long offset,
                                             long size)
        Returns a new ContentReference that is a copy of a portion of this ContentReference, at the given offset and size Handles piecing together the underlying segments properly
        Parameters:
        offset - Number of bytes at which to offset the new ContentReference
        size - Size in bytes of the new ContentReference
        Returns:
        A trimmed down ContentReference