Skip to content

Instantly share code, notes, and snippets.

/**
* Default implementation of {@link #getRef()} method based on type and id.
* <p>
* This method create ref which looks like this: "type_name:id"
* This is most often used in API as ref, but there is no guaranty.
*/
@NonNull
static String createRef(@EntityType int entityType,
@Nullable String entityId) {
return EntityType.Utils.getApiName(entityType) + ":" + entityId;