Package org.ivoa.dm.proposal.management
Class AvailableResources
java.lang.Object
org.ivoa.dm.proposal.management.AvailableResources
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations
,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="proposalManagement:AvailableResources",
role=objectType)
public class AvailableResources
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
The list of resources that are available.
objectType: AvailableResources
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A builder class for AvailableResources, mainly for use in the functional builder pattern. -
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a new AvailableResourcesAvailableResources
(List<Resource> resources) full parameter constructor.Copy Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a org.ivoa.dm.proposal.management.Resource to the composition.static AvailableResources
create a AvailableResources in functional builder style.void
getId()
Returns resources composition as an immutable list.void
persistRefs
(jakarta.persistence.EntityManager _em) Deprecated.generally better to use the model level reference persistence as only this can deal with "contained" references properly.void
Remove a org.ivoa.dm.proposal.management.Resource from the composition.void
update a org.ivoa.dm.proposal.management.Resource in the composition.void
setResources
(List<Resource> pResources) Defines whole resources composition.void
updateUsing
(AvailableResources other) Update this object with the content of the given object.
-
Field Details
-
Constructor Details
-
AvailableResources
public AvailableResources()Creates a new AvailableResources -
AvailableResources
full parameter constructor.- Parameters:
resources
- .
-
AvailableResources
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:
getId
in 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.
-
getResources
Returns resources composition as an immutable list.- Returns:
- resources composition.
-
setResources
Defines whole resources composition.- Parameters:
pResources
- composition to set.
-
addToResources
Add a org.ivoa.dm.proposal.management.Resource to the composition.- Parameters:
p
- org.ivoa.dm.proposal.management.Resource to add
-
removeFromResources
Remove a org.ivoa.dm.proposal.management.Resource from the composition.- Parameters:
p
- org.ivoa.dm.proposal.management.Resource to remove
-
replaceInResources
update a org.ivoa.dm.proposal.management.Resource in the composition.- Parameters:
_p
- org.ivoa.dm.proposal.management.Resource to update the match is done via the database key
-
createAvailableResources
public static AvailableResources createAvailableResources(Consumer<AvailableResources.AvailableResourcesBuilder> f) create a AvailableResources in functional builder style.- Parameters:
f
- the functional builder.- Returns:
- an object initialized from the builder.
-
forceLoad
public void forceLoad()- Specified by:
forceLoad
in interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
persistRefs
Deprecated.generally better to use the model level reference persistence as only this can deal with "contained" references properly.- Specified by:
persistRefs
in interfaceorg.ivoa.vodml.jpa.JPAManipulations
-