/** * <p> * Returns a {@code String} representation of the specified resource. The format of this representation * is as follows: {@code resource_fqn:resource_id}, where {@code resource_fqn} is the fully-qualified * name of the resource class, and {@code resource_id} is the unique identifier of the resource. * </p> * * @param resource the {@code Resource} to be converted. * @return a {@code String} representation of the resource. */ public static String getResourceAsString(Resource resource) { String resourceString = null; if (resource != null) { String resourceClass = resource.getClass().getCanonicalName(); resourceString = resourceClass + ":" + getResourceKey(resource); } return resourceString; }
/** * <p> * Returns a {@code String} representation of the specified resource. The format of this representation * is as follows: {@code resource_fqn:resource_id}, where {@code resource_fqn} is the fully-qualified * name of the resource class, and {@code resource_id} is the unique identifier of the resource. * </p> * * @param resource the {@code Resource} to be converted. * @return a {@code String} representation of the resource. */ public static String getResourceAsString(Resource resource) { String resourceString = null; if (resource != null) { String resourceClass = resource.getClass().getCanonicalName(); resourceString = resourceClass + ":" + getResourceKey(resource); } return resourceString; }