Class Substance.Instance

  • All Implemented Interfaces:
    Visitable
    Enclosing class:
    Substance

    public static class Substance.Instance
    extends BackboneElement
    Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.
    • Method Detail

      • getIdentifier

        public Identifier getIdentifier()
        Identifier associated with the package/container (usually a label affixed directly).
        Returns:
        An immutable object of type Identifier that may be null.
      • getExpiry

        public DateTime getExpiry()
        When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
        Returns:
        An immutable object of type DateTime that may be null.
      • getQuantity

        public SimpleQuantity getQuantity()
        The amount of the substance.
        Returns:
        An immutable object of type SimpleQuantity that may be null.
      • accept

        public void accept​(java.lang.String elementName,
                           int elementIndex,
                           Visitor visitor)
        Description copied from interface: Visitable
        Accept a Visitor and invoke the appropriate visit methods. A typical implementation would look like this:
         if (visitor.preVisit(this)) {
             visitor.visitStart(elementName, elementIndex, this);
             if (visitor.visit(elementName, elementIndex, this)) {
                 // visit children
             }
             visitor.visitEnd(elementName, elementIndex, this);
             visitor.postVisit(this);
         }
         
        Specified by:
        accept in interface Visitable
        Specified by:
        accept in class AbstractVisitable
        Parameters:
        elementName - the name of the element in the context of this visit
        elementIndex - the index of the element in a list or -1 if it is not contained within a List
        visitor - the visitor to use
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object