Package com.janeirodigital.sai.core.data
Class DataRegistration.Builder
java.lang.Object
com.janeirodigital.sai.core.resources.ReadableResource.Builder<T>
com.janeirodigital.sai.core.resources.CRUDResource.Builder<DataRegistration.Builder>
com.janeirodigital.sai.core.data.DataRegistration.Builder
- Enclosing class:
- DataRegistration
Builder for
DataRegistration
instances.-
Field Summary
Fields inherited from class com.janeirodigital.sai.core.resources.ReadableResource.Builder
contentType, dataset, exists, jsonLdContext, resource, saiSession, unprotected, uri
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder
(URI uri, SaiSession saiSession) Initialize builder withuri
andsaiSession
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theDataRegistration
using attributes from the Builder.getThis()
Ensures that don't get an unchecked cast warning when returning from setterssetDataset
(org.apache.jena.rdf.model.Model dataset) Set the Jena model and use it to populate attributes of theDataRegistration.Builder
.setRegisteredAt
(OffsetDateTime registeredAt) Set the time the data registration was registeredsetRegisteredBy
(URI registeredBy) Set the URI of the social agent that registered the data registrationsetRegisteredShapeTree
(URI registeredShapeTree) Set the registered shape tree for the data registrationsetRegisteredWith
(URI registeredWith) Set the URI of the application used to register the data registrationsetUpdatedAt
(OffsetDateTime updatedAt) Set the time the data registration was updatedMethods inherited from class com.janeirodigital.sai.core.resources.ReadableResource.Builder
setContentType, setDataset, setJsonLdContext, setUnprotected
-
Constructor Details
-
Builder
Initialize builder withuri
andsaiSession
- Parameters:
uri
- URI of theDataRegistration
to buildsaiSession
-SaiSession
to assign
-
-
Method Details
-
getThis
Ensures that don't get an unchecked cast warning when returning from setters- Specified by:
getThis
in classReadableResource.Builder<DataRegistration.Builder>
- Returns:
DataRegistration.Builder
-
setDataset
public DataRegistration.Builder setDataset(org.apache.jena.rdf.model.Model dataset) throws SaiException Set the Jena model and use it to populate attributes of theDataRegistration.Builder
. Assumption is made that the corresponding resource exists.- Overrides:
setDataset
in classReadableResource.Builder<DataRegistration.Builder>
- Parameters:
dataset
- Jena model to populate the Builder attributes with- Returns:
DataRegistration.Builder
- Throws:
SaiException
-
setRegisteredBy
Set the URI of the social agent that registered the data registration- Parameters:
registeredBy
- URI of the registering social agent- Returns:
DataRegistration.Builder
-
setRegisteredWith
Set the URI of the application used to register the data registration- Parameters:
registeredWith
- URI of the registering application- Returns:
DataRegistration.Builder
-
setRegisteredAt
Set the time the data registration was registered- Parameters:
registeredAt
- time the registration was updated- Returns:
DataRegistration.Builder
-
setUpdatedAt
Set the time the data registration was updated- Parameters:
updatedAt
- time the registration was updated- Returns:
DataRegistration.Builder
-
setRegisteredShapeTree
Set the registered shape tree for the data registration- Parameters:
registeredShapeTree
- URI of the registered shape tree- Returns:
DataRegistration.Builder
-
build
Build theDataRegistration
using attributes from the Builder. If no Jena dataset has been provided, then the dataset will be populated using the attributes from the Builder withpopulateDataset()
.- Returns:
DataRegistration
- Throws:
SaiException
-