Package org.deltafi.common.content
Class ContentReference
- java.lang.Object
-
- org.deltafi.common.content.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 objectContentReference(java.lang.String mediaType, Segment... segments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetSize()Calculate size of all the segmentsvoidsetSize(long ignored)Empty method in place for object mappers trying to set the size from JSONContentReferencesubreference(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
-
-
-
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- mediaTypesegments- segmentsignored- 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 ContentReferencesize- Size in bytes of the new ContentReference- Returns:
- A trimmed down ContentReference
-
-