class ImmutablePolicyEntry implements PolicyEntry {

    public static PolicyEntry fromJson(final CharSequence label, final JsonObject jsonObject) {
        checkNotNull(jsonObject, "JSON object");
        final Label lbl = Label.of(label);

        try {
            final JsonObject subjectsJsonObject = jsonObject.getValueOrThrow(JsonFields.SUBJECTS);
            final Subjects subjectsFromJson = PoliciesModelFactory.newSubjects(subjectsJsonObject);
            final JsonObject resourcesJsonObject = jsonObject.getValueOrThrow(JsonFields.RESOURCES);
            final Resources resourcesFromJson = PoliciesModelFactory.newResources(resourcesJsonObject);

            return of(lbl, subjectsFromJson, resourcesFromJson);
        } catch (final JsonMissingFieldException e) {
            throw new DittoJsonException(e);
        }
    }

    private  ImmutablePolicyEntry(final Label theLabel, final Subjects theSubjects, final Resources theResources);

}