Class ResourceBlock

java.lang.Object
org.ivoa.dm.proposal.management.ResourceBlock
All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations, org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
Direct Known Subclasses:
AllocatedBlock

@Entity @VoDml(id="proposalManagement:ResourceBlock", role=objectType) public class ResourceBlock extends Object implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A block of resources that can be allocated. objectType: ResourceBlock
  • Field Details

    • _id

      protected Long _id
      inserted database key
    • resource

      @VoDml(id="proposalManagement:ResourceBlock.resource", role=composition, type="proposalManagement:Resource", typeRole=objectType) protected Resource resource
      the amount of resource. composition resource : ( Multiplicity : 1 )
    • mode

      @VoDml(id="proposalManagement:ResourceBlock.mode", role=reference, type="proposal:ObservingMode", typeRole=objectType) protected ObservingMode mode
      ReferenceObject mode : . ( Multiplicity : 1 )
  • Constructor Details

    • ResourceBlock

      public ResourceBlock()
      Creates a new ResourceBlock
    • ResourceBlock

      public ResourceBlock(ObservingMode mode, Resource resource)
      full parameter constructor.
      Parameters:
      mode - .
      resource - the amount of resource.
    • ResourceBlock

      public ResourceBlock(ResourceBlock other)
      Copy Constructor. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
      Returns:
      the id
    • copyMe

      public ResourceBlock copyMe()
    • updateClonedReferences

      public void updateClonedReferences()
      updates any cloned references that are contained within the hierarchy.
    • updateUsing

      public void updateUsing(ResourceBlock other)
      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.
    • getMode

      public ObservingMode getMode()
      Returns mode Reference
      Returns:
      mode Reference
    • setMode

      public void setMode(ObservingMode pMode)
      Defines mode Reference
      Parameters:
      pMode - reference to set
    • getResource

      public Resource getResource()
      Returns resource Attribute
      Returns:
      resource Attribute
    • setResource

      public void setResource(Resource pResource)
      Defines resource Attribute
      Parameters:
      pResource - value to set
    • withResource

      public ResourceBlock withResource(Resource pResource)
    • createResourceBlock

      public static ResourceBlock createResourceBlock(Consumer<ResourceBlock.ResourceBlockBuilder> f)
      create a ResourceBlock in functional builder style.
      Parameters:
      f - the functional builder.
      Returns:
      an object initialized from the builder.
    • forceLoad

      public void forceLoad()
      Specified by:
      forceLoad in interface org.ivoa.vodml.jpa.JPAManipulations
    • jpaClone

      public void jpaClone(jakarta.persistence.EntityManager em)
      Specified by:
      jpaClone in interface org.ivoa.vodml.jpa.JPAManipulations
    • persistRefs

      public void persistRefs(jakarta.persistence.EntityManager _em)
      Specified by:
      persistRefs in interface org.ivoa.vodml.jpa.JPAManipulations