/** * Returns a DNAnexus link for this object. This is the JSON serializer so it makes it suitable to * provide an object with references to DXDataObjects as the input when running a {@link * DXApplet}, etc. * * @return a DNAnexus link */ @JsonValue private JsonNode getDXLink() { return DXJSON.getObjectBuilder().put("$dnanexus_link", this.getId()).build(); }
/** * Returns metadata about the data object, like {@link DXDataObject#describe()}, but without * making an API call. * * <p>This cached describe info is only available if this object appears in the result of a {@link * DXSearch#findDataObjects()} call that specified {@link * DXSearch.FindDataObjectsRequestBuilder#includeDescribeOutput()}, and the describe info that is * returned reflects the state of the object at the time that the search was performed. * * @return a {@code Describe} containing the data object's metadata * @throws IllegalStateException if no cached describe info is available */ public Describe getCachedDescribe() { this.checkCachedDescribeAvailable(); return DXJSON.safeTreeToValue(this.cachedDescribe, Describe.class); }
/** * Returns metadata about the data object, specifying which optional fields are to be returned and * what project to obtain project-specific metadata from. * * @param options {@code DescribeOptions} object specifying how the {@code describe} request is to * be made. * @return a {@code Describe} containing the data object's metadata. */ public Describe describe(DescribeOptions options) { return DXJSON.safeTreeToValue( apiCallOnObject("describe", MAPPER.valueToTree(options), RetryStrategy.SAFE_TO_RETRY), Describe.class); }
/** * Returns metadata about the data object. * * <p>The properties and details fields will not be returned, and any project-specific metadata * fields will be selected from an arbitrary project in which the requesting user has access to * this object. To change either of these aspects of this behavior, use {@link * #describe(DescribeOptions)} instead. * * @return a {@code Describe} containing the data object's metadata. */ public Describe describe() { return DXJSON.safeTreeToValue( apiCallOnObject("describe", RetryStrategy.SAFE_TO_RETRY), Describe.class); }
/** * Deserializes the response to a {@code /class-xxxx/new} API call and returns the ID of the * newly created object. * * @return DNAnexus object ID */ protected static String getNewObjectId(JsonNode responseJson) { return DXJSON.safeTreeToValue(responseJson, DataObjectNewResponse.class).id; }
/** * Returns the details of the object. This field may not be available unless {@link * DXDataObject#describe(DescribeOptions)} (or {@link * DXSearch.FindDataObjectsRequestBuilder#includeDescribeOutput(DXDataObject.DescribeOptions)} ) * was called with {@link DescribeOptions#withDetails()} set. * * @param valueType class to deserialize as * @return the object's details * @throws IllegalStateException if details were not retrieved with the describe call */ public <T> T getDetails(Class<T> valueType) { Preconditions.checkState( this.details != null, "details are not accessible because they were not retrieved with the describe call"); return DXJSON.safeTreeToValue(this.details, valueType); }