Package org.ivoa.dm.proposal.management
Class Resource
java.lang.Object
org.ivoa.dm.proposal.management.Resource
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="proposalManagement:Resource",
role=objectType)
public class Resource
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A resource that will be consumed by allocating an observation from a proposal.
objectType: Resource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for Resource, mainly for use in the functional builder pattern. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Resourcecreate a Resource in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns amount Attribute.getId()getType()Returns type ReferencevoidSet amount Attribute.voidsetType(ResourceType pType) Defines type ReferencevoidupdateUsing(Resource other) Update this object with the content of the given object.withAmount(Double pAmount) fluent setter for amount Attribute.
-
Field Details
-
_id
inserted database key -
type
@VoDml(id="proposalManagement:Resource.type", role=reference, type="proposalManagement:ResourceType", typeRole=objectType) protected ResourceType typeReferenceObject type : the type of the resource. ( Multiplicity : 1 ) -
amount
@VoDml(id="proposalManagement:Resource.amount", role=attribute, type="ivoa:real", typeRole=primitiveType) protected Double amountThe amount of the resource. : Attribute amount : multiplicity 1
-
-
Constructor Details
-
Resource
public Resource()Creates a new Resource -
Resource
full parameter constructor.- Parameters:
type- the type of the resource.amount- The amount of the resource.
-
Resource
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>- Returns:
- the id
-
updateUsing
Update this object with the content of the given object. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
getType
Returns type Reference- Returns:
- type Reference
-
setType
Defines type Reference- Parameters:
pType- reference to set
-
getAmount
Returns amount Attribute.- Returns:
- amount Attribute
-
setAmount
Set amount Attribute.- Parameters:
pAmount- value to set
-
withAmount
fluent setter for amount Attribute.- Parameters:
pAmount- value to set- Returns:
- Resource
-
createResource
create a Resource in functional builder style.- Parameters:
f- the functional builder.- Returns:
- an object initialized from the builder.
-
forceLoad
public void forceLoad()- Specified by:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
-