Skip to content

Instantly share code, notes, and snippets.

@imort
Created September 10, 2019 13:57
Show Gist options
  • Save imort/fa48e2c2652afe3a353e493b0b2a4f34 to your computer and use it in GitHub Desktop.
Save imort/fa48e2c2652afe3a353e493b0b2a4f34 to your computer and use it in GitHub Desktop.
/**
* 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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment