Class Contract


  • public final class Contract
    extends MgrObject<ContractID>
    This class represents a system contract.
    • Constructor Detail

      • Contract

        public Contract()
        Basic constructor
      • Contract

        public Contract​(String namespaceOfProvider,
                        AccountID providerID,
                        Set<AccountID> newapplicantsIDs,
                        List<InterfaceInContract> newInterfacesInContract,
                        Calendar beginDateOfContract,
                        Calendar endDateOfContract)
        Builds a new contract
        Parameters:
        namespaceOfProvider - the namespace of the provider of the contract
        accountOfProvider - Account name of provider
        newapplicantsNames - the applicants account names
        newInterfacesInContract - the interfaces this contract can access and accessible method implementations
        beginDateOfContract - the date this contract is valid from
        endDateOfContract - the date this contract expires
      • Contract

        public Contract​(String namespaceOfProvider,
                        String accountOfProvider,
                        List<InterfaceInContract> newInterfacesInContract,
                        Calendar beginDateOfContract,
                        Calendar endDateOfContract)
        Builds a new public contract
        Parameters:
        namespaceOfProvider - the namespace of the provider of the contract
        accountOfProvider - Account name of provider
        newInterfacesInContract - the interfaces this contract can access and accessible method implementations
        beginDateOfContract - the date this contract is valid from
        endDateOfContract - the date this contract expires
    • Method Detail

      • getNamespace

        public String getNamespace()
        Get the Contract::namespace
        Returns:
        the namespace
      • setNamespace

        public void setNamespace​(String newnamespace)
        Set the Contract::namespace
        Parameters:
        newnamespace - the namespace to set
      • getApplicantsAccountsIDs

        public Set<AccountID> getApplicantsAccountsIDs()
        Returns:
        the applicantsAccountsID
      • setApplicantsAccountsIDs

        public void setApplicantsAccountsIDs​(Set<AccountID> accountsIDsofTheApplicants)
        Parameters:
        accountsIDsofTheApplicants - the applicantAccountID to set
      • getInterfacesInContractSpecs

        public List<InterfaceInContract> getInterfacesInContractSpecs()
        Get the Contract::interfacesInContractSpecs
        Returns:
        the interfacesInContractSpecs
      • setInterfacesInContractSpecs

        public void setInterfacesInContractSpecs​(List<InterfaceInContract> newinterfacesInContractSpecs)
        Set the Contract::interfacesInContractSpecs
        Parameters:
        newinterfacesInContractSpecs - the interfacesInContractSpecs to set
      • setInterfacesInContract

        public void setInterfacesInContract​(Map<InterfaceID,​InterfaceInContract> newInterfacesInContract)
        Parameters:
        newInterfacesInContract - the interfacesInContract to set
      • getProviderAccountID

        public AccountID getProviderAccountID()
        Get the Contract::providerAccount
        Returns:
        the providerAccount
      • setProviderAccountID

        public void setProviderAccountID​(AccountID newproviderAccount)
        Set the Contract::providerAccount
        Parameters:
        newproviderAccount - the providerAccount to set
      • getBeginDate

        public Calendar getBeginDate()
        Returns:
        the beginDate
      • setBeginDate

        public void setBeginDate​(Calendar beginDateOfContract)
        Parameters:
        beginDateOfContract - the beginDate to set
      • getEndDate

        public Calendar getEndDate()
        Returns:
        the endDate
      • setEndDate

        public void setEndDate​(Calendar endDateOfContract)
        Parameters:
        endDateOfContract - the endDate to set
      • isPublicAvailable

        public boolean isPublicAvailable()
        Returns:
        the isPublic
      • setPublicAvailable

        public void setPublicAvailable​(boolean isContractPublic)
        Parameters:
        isContractPublic - whether the contract must be set as public or not
      • isActive

        public boolean isActive()
        Returns:
        the isActive
      • getNamespaceID

        public NamespaceID getNamespaceID()
        Get the Contract::namespaceID
        Returns:
        the namespaceID
      • setNamespaceID

        public void setNamespaceID​(NamespaceID newnamespaceID)
        Set the Contract::namespaceID
        Parameters:
        newnamespaceID - the namespaceID to set
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object