class Crn {

    public String getUserId() {
        checkState(resourceType == ResourceType.USER || resourceType == ResourceType.MACHINE_USER,
            String.format("CRN %s has no user ID because it is of type %s", toString(), resourceType));
        int idx = resource.indexOf('/');
        return idx == -1 ? resource : resource.substring(idx + 1);
    }

    public  Crn(Partition partition,
            Service service,
            Region region,
            String accountId,
            ResourceType resourceType,
            String resource);

}