Class SocialAgentRegistration.Builder
java.lang.Object
com.janeirodigital.sai.core.resources.ReadableResource.Builder<T>
com.janeirodigital.sai.core.resources.CRUDResource.Builder<T>
com.janeirodigital.sai.core.agents.AgentRegistration.Builder<SocialAgentRegistration.Builder>
com.janeirodigital.sai.core.agents.SocialAgentRegistration.Builder
- Enclosing class:
- SocialAgentRegistration
public static class SocialAgentRegistration.Builder
extends AgentRegistration.Builder<SocialAgentRegistration.Builder>
Builder for
SocialAgentRegistration instances.-
Field Summary
Fields inherited from class com.janeirodigital.sai.core.agents.AgentRegistration.Builder
accessGrantUri, registeredAgent, registeredAt, registeredBy, registeredWith, updatedAtFields 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 withuriandsaiSession -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build theSocialAgentRegistrationusing attributes from the Builder.getThis()Ensures that we don't get an unchecked cast warning when returning from settersprotected voidPopulates the Jena dataset graph with the attributes from the Builderprotected voidPopulates the fields of theSocialAgentRegistration.Builderbased on the associated Jena resource.setDataset(org.apache.jena.rdf.model.Model dataset) Set the Jena model and use it to populate attributes of theSocialAgentRegistration.Builder.setReciprocalRegistration(URI registrationUri) Set the Reciprocal Registration thatregisteredAgentmaintains for the social agent that owns the agent registry.Methods inherited from class com.janeirodigital.sai.core.agents.AgentRegistration.Builder
setAccessGrant, setRegisteredAgent, setRegisteredAt, setRegisteredBy, setRegisteredWith, setUpdatedAtMethods inherited from class com.janeirodigital.sai.core.resources.ReadableResource.Builder
setContentType, setDataset, setJsonLdContext, setUnprotected
-
Constructor Details
-
Builder
Initialize builder withuriandsaiSession- Parameters:
uri- URI of theSocialAgentRegistrationto buildsaiSession-SaiSessionto assign
-
-
Method Details
-
getThis
Ensures that we don't get an unchecked cast warning when returning from setters- Specified by:
getThisin classReadableResource.Builder<SocialAgentRegistration.Builder>- Returns:
SocialAgentRegistration.Builder
-
setDataset
public SocialAgentRegistration.Builder setDataset(org.apache.jena.rdf.model.Model dataset) throws SaiException Set the Jena model and use it to populate attributes of theSocialAgentRegistration.Builder. Assumption is made that the corresponding resource exists.- Overrides:
setDatasetin classReadableResource.Builder<SocialAgentRegistration.Builder>- Parameters:
dataset- Jena model to populate the Builder attributes with- Returns:
SocialAgentRegistration.Builder- Throws:
SaiException
-
setReciprocalRegistration
Set the Reciprocal Registration thatregisteredAgentmaintains for the social agent that owns the agent registry.- Parameters:
registrationUri- URI of the reciprocal social agent registration- See Also:
-
populateFromDataset
Populates the fields of theSocialAgentRegistration.Builderbased on the associated Jena resource.- Overrides:
populateFromDatasetin classAgentRegistration.Builder<SocialAgentRegistration.Builder>- Throws:
SaiException
-
populateDataset
protected void populateDataset()Populates the Jena dataset graph with the attributes from the Builder- Overrides:
populateDatasetin classAgentRegistration.Builder<SocialAgentRegistration.Builder>
-
build
Build theSocialAgentRegistrationusing 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:
DataGrant- Throws:
SaiException
-