Class ReprintableSourceDocument<D extends BaseOBObject & ClientEnabled & OrganizationEnabled>
- java.lang.Object
-
- org.openbravo.client.application.attachment.ReprintableSourceDocument<D>
-
- Direct Known Subclasses:
ReprintableInvoice
,ReprintableOrder
public abstract class ReprintableSourceDocument<D extends BaseOBObject & ClientEnabled & OrganizationEnabled> extends Object
Represents a document used as the source to generate the data of aReprintableDocument
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ReprintableSourceDocument.DocumentType
Supported document types that can be linked to aReprintableDocument
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReprintableSourceDocument(String id)
Builds a new source document for aReprintableDocument
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
exists()
protected String
getId()
protected abstract String
getName()
Optional<ReprintableDocument>
getReprintableDocument()
static ReprintableSourceDocument<?>
newSourceDocument(String id, ReprintableSourceDocument.DocumentType documentType)
Retrieves aReprintableSourceDocument
instance with the information of the document identified by the provided ID and document type.
-
-
-
Constructor Detail
-
ReprintableSourceDocument
protected ReprintableSourceDocument(String id)
Builds a new source document for aReprintableDocument
- Parameters:
id
- the ID of the source document
-
-
Method Detail
-
newSourceDocument
public static ReprintableSourceDocument<?> newSourceDocument(String id, ReprintableSourceDocument.DocumentType documentType)
Retrieves aReprintableSourceDocument
instance with the information of the document identified by the provided ID and document type.- Parameters:
id
- The ID of the BaseOBObject of the source documentdocumentType
- The type of source document- Returns:
- the source document with the information of the document referenced by the given parameters
-
getName
protected abstract String getName()
- Returns:
- a name that identifies the document
-
getId
protected String getId()
-
exists
public boolean exists()
- Returns:
- true if the document exists in the database or false otherwise
-
getReprintableDocument
public Optional<ReprintableDocument> getReprintableDocument()
- Returns:
- an Optional representing the ReprintableDocument linked to the document. If the document does not have a ReprintableDocument linked to it, an empty Optional is returned.
-
-