@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { return Optional.of(policyEntry.toJson(schemaVersion, FieldType.regularOrSpecial())); }
@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { return Optional.of(policyEntry.toJson(schemaVersion, FieldType.regularOrSpecial())); }
@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { return Optional.of(policyEntry.toJson(schemaVersion, FieldType.regularOrSpecial())); }
/** * Returns all non hidden marked fields of this Policy entry. * * @return a JSON object representation of this Policy entry including only non hidden marked fields. */ @Override default JsonObject toJson() { return toJson(FieldType.notHidden()); }
@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { return Optional.of(policyEntry.toJson(schemaVersion, FieldType.regularOrSpecial())); }
@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { final JsonObject jsonObject = StreamSupport.stream(policyEntries.spliterator(), false) .map(entry -> JsonFactory.newObjectBuilder() .set(entry.getLabel().getJsonFieldDefinition(), entry.toJson(schemaVersion, FieldType.regularOrSpecial())) .build()) .collect(JsonCollectors.objectsToObject()); return Optional.ofNullable(jsonObject); }
@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { final JsonObject jsonObject = StreamSupport.stream(policyEntries.spliterator(), false) .map(entry -> JsonFactory.newObjectBuilder() .set(entry.getLabel().getJsonFieldDefinition(), entry.toJson(schemaVersion, FieldType.regularOrSpecial())) .build()) .collect(JsonCollectors.objectsToObject()); return Optional.ofNullable(jsonObject); }
@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { final JsonObject jsonObject = StreamSupport.stream(policyEntries.spliterator(), false) .map(entry -> JsonFactory.newObjectBuilder() .set(entry.getLabel().getJsonFieldDefinition(), entry.toJson(schemaVersion, FieldType.regularOrSpecial())) .build()) .collect(JsonCollectors.objectsToObject()); return Optional.ofNullable(jsonObject); }
@Override public Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion) { final JsonObject jsonObject = StreamSupport.stream(policyEntries.spliterator(), false) .map(entry -> JsonFactory.newObjectBuilder() .set(entry.getLabel().getJsonFieldDefinition(), entry.toJson(schemaVersion, FieldType.regularOrSpecial())) .build()) .collect(JsonCollectors.objectsToObject()); return Optional.ofNullable(jsonObject); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(JSON_LABEL, policyEntry.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntry.toJson(schemaVersion, thePredicate), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(JSON_LABEL, policyEntry.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntry.toJson(schemaVersion, thePredicate), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(JSON_LABEL, policyEntry.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntry.toJson(schemaVersion, thePredicate), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(JSON_LABEL, policyEntry.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntry.toJson(schemaVersion, thePredicate), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(JSON_POLICY_ENTRIES, StreamSupport.stream(policyEntries.spliterator(), false) .map(entry -> JsonFactory.newObjectBuilder().set(entry.getLabel().getJsonFieldDefinition(), entry.toJson(schemaVersion, thePredicate), predicate).build()) .collect(JsonCollectors.objectsToObject()), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(JSON_POLICY_ENTRIES, StreamSupport.stream(policyEntries.spliterator(), false) .map(entry -> JsonFactory.newObjectBuilder().set(entry.getLabel().getJsonFieldDefinition(), entry.toJson(schemaVersion, thePredicate), predicate).build()) .collect(JsonCollectors.objectsToObject()), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(PolicyModifyCommand.JsonFields.JSON_POLICY_ID, policyId, predicate); jsonObjectBuilder.set(JSON_LABEL, policyEntry.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntry.toJson(schemaVersion, thePredicate), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(PolicyModifyCommand.JsonFields.JSON_POLICY_ID, policyId, predicate); jsonObjectBuilder.set(JSON_LABEL, policyEntry.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntry.toJson(schemaVersion, thePredicate), predicate); }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(PolicyModifyCommandResponse.JsonFields.JSON_POLICY_ID, policyId, predicate); if (null != policyEntryCreated) { jsonObjectBuilder.set(JSON_LABEL, policyEntryCreated.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntryCreated.toJson(schemaVersion, thePredicate), predicate); } }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(PolicyModifyCommandResponse.JsonFields.JSON_POLICY_ID, policyId, predicate); if (null != policyEntryCreated) { jsonObjectBuilder.set(JSON_LABEL, policyEntryCreated.getLabel().toString(), predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRY, policyEntryCreated.toJson(schemaVersion, thePredicate), predicate); } }
@Override protected void appendPayload(final JsonObjectBuilder jsonObjectBuilder, final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate) { final Predicate<JsonField> predicate = schemaVersion.and(thePredicate); jsonObjectBuilder.set(PolicyModifyCommand.JsonFields.JSON_POLICY_ID, policyId, predicate); jsonObjectBuilder.set(JSON_POLICY_ENTRIES, StreamSupport.stream(policyEntries.spliterator(), false) .map(entry -> JsonFactory.newObjectBuilder() .set(entry.getLabel().getJsonFieldDefinition(), entry.toJson(schemaVersion, thePredicate), predicate) .build()) .collect(JsonCollectors.objectsToObject()), predicate); }