@SuppressWarnings("unchecked") public DR getRole() { return (role == null) ? (DR) DataRole.valueOf(getId()) : role; }
@SuppressWarnings("unchecked") public DR getRole() { return (role == null) ? (DR) DataRole.valueOf(getId()) : role; }
@SuppressWarnings("unchecked") @Override public Builder<R> withId(String id) { return withRole((R) DataRole.valueOf(id)); }
@SuppressWarnings("unchecked") @Override public Builder<R> withId(String id) { return withRole((R) DataRole.valueOf(id)); }
public DataRole getRole() { return DataRole.valueOf(getId()); }
public DataRole getRole() { return DataRole.valueOf(getId()); }
public DataEntity(CanonicalPath path, StructuredData value, String identityHash, String contentHash, String syncHash, Map<String, Object> properties) { this(path.up(), DataRole.valueOf(path.getSegment().getElementId()), value, identityHash, contentHash, syncHash, properties); }
public DataEntity(CanonicalPath path, StructuredData value, Map<String, Object> properties) { this(path.up(), DataRole.valueOf(path.getSegment().getElementId()), value, properties); }
public static <BE> void validate(Transaction<BE> tx, StructuredData data, BE dataEntity) { CanonicalPath path = tx.extractCanonicalPath(dataEntity); DataRole role = DataRole.valueOf(path.ids().getDataRole()); if (role.isSchema()) { try { JsonNode schema = new JsonNodeReader(new ObjectMapper()) .fromInputStream(BaseData.class.getResourceAsStream("/json-meta-schema.json")); CanonicalPath dataPath = tx.extractCanonicalPath(dataEntity); validate(dataPath, convert(data), schema); } catch (IOException e) { throw new IllegalStateException("Could not load the embedded JSON Schema meta-schema."); } } else { validateIfSchemaFound(tx, data, dataEntity, Query.path().with(navigateToSchema(role)).get()); } }
CanonicalPath cp = extractCanonicalPath(v); String identityHash = extractIdentityHash(v); e = new DataEntity(cp.up(), DataRole.valueOf(cp.getSegment().getElementId()), loadStructuredData(v, hasData), identityHash, extractContentHash(v), extractSyncHash(v)); break;