use of io.lumeer.api.model.function.FunctionResourceType in project engine by Lumeer.
the class FunctionRowCodec method decode.
@Override
public FunctionRow decode(final BsonReader reader, final DecoderContext decoderContext) {
Document bson = documentCodec.decode(reader, decoderContext);
String resourceId = bson.getString(RESOURCE_ID);
FunctionResourceType type = FunctionResourceType.valueOf(bson.getString(TYPE));
String attributeId = bson.getString(ATTRIBUTE_ID);
String dependentCollectionId = bson.getString(DEPENDENT_COLLECTION_ID);
String dependentLinkTypeId = bson.getString(DEPENDENT_LINK_TYPE_ID);
String dependentAttributeId = bson.getString(DEPENDENT_ATTRIBUTE_ID);
return new FunctionRow(resourceId, type, attributeId, dependentCollectionId, dependentLinkTypeId, dependentAttributeId);
}
use of io.lumeer.api.model.function.FunctionResourceType in project engine by Lumeer.
the class FunctionFacade method functionRowToParameter.
private FunctionParameterDocuments functionRowToParameter(FunctionRow row) {
String resourceId = row.getDependentCollectionId() != null ? row.getDependentCollectionId() : row.getDependentLinkTypeId();
FunctionResourceType type = row.getDependentCollectionId() != null ? FunctionResourceType.COLLECTION : FunctionResourceType.LINK;
return new FunctionParameterDocuments(type, resourceId, row.getDependentAttributeId());
}
Aggregations