public class Attachment extends VdmEntity<Attachment>
Original entity name from the Odata EDM: Attachment
Modifier and Type | Class and Description |
---|---|
static class |
Attachment.AttachmentBuilder |
Modifier and Type | Field and Description |
---|---|
static AttachmentSelectable |
ALL_FIELDS
Selector for all available fields of Attachment.
|
static AttachmentField<UUID> |
ATTACHMENT_DOCUMENT_UUID
Use with available fluent helpers to apply the AttachmentDocumentUUID field to query operations.
|
static AttachmentField<String> |
FILE_NAME
Use with available fluent helpers to apply the FileName field to query operations.
|
static AttachmentField<String> |
MIME_TYPE
Use with available fluent helpers to apply the MimeType field to query operations.
|
changedOriginalFields
Constructor and Description |
---|
Attachment() |
Attachment(UUID attachmentDocumentUUID,
String mimeType,
String fileName) |
Modifier and Type | Method and Description |
---|---|
void |
attachToService(String servicePath,
HttpDestinationProperties destination)
Sets the service path and destination for the fetch commands of this entity.
|
static Attachment.AttachmentBuilder |
builder() |
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
InputStream |
fetchAsStream()
Get the binary data stream (file) from this entity.In the OData world this would be the
/$value path. |
static <T> AttachmentField<T> |
field(String fieldName,
Class<T> fieldType)
Use with available fluent helpers to apply an extension field to query operations.
|
static <T,DomainT> |
field(String fieldName,
TypeConverter<T,DomainT> typeConverter)
Use with available fluent helpers to apply an extension field to query operations.
|
protected void |
fromMap(Map<String,Object> inputValues) |
UUID |
getAttachmentDocumentUUID()
(Key Field) Constraints: Not nullable
|
protected String |
getDefaultServicePath()
Used by fluent helpers and navigation property methods to construct OData queries.
|
HttpDestinationProperties |
getDestinationForFetch()
Convienence field for reusing the same destination with multiple queries (e.g.
|
protected String |
getEntityCollection()
Used by fluent helpers and navigation property methods to construct OData queries.
|
String |
getFileName()
Constraints: Not nullable, Maximum length: 255
|
protected Map<String,Object> |
getKey() |
String |
getMimeType()
Constraints: Not nullable, Maximum length: 128
|
Class<Attachment> |
getType() |
int |
hashCode() |
void |
setAttachmentDocumentUUID(UUID attachmentDocumentUUID)
(Key Field) Constraints: Not nullable
|
void |
setFileName(String fileName)
Constraints: Not nullable, Maximum length: 255
|
void |
setMimeType(String mimeType)
Constraints: Not nullable, Maximum length: 128
|
protected void |
setServicePathForFetch(String servicePathForFetch)
The service path only used for the fetch commands of this entity.
|
protected Map<String,Object> |
toMapOfFields() |
String |
toString() |
getServicePathForFetch, getVersionIdentifier, setDestinationForFetch, setVersionIdentifier
getChangedFields, getCustomField, getCustomField, getCustomFieldNames, getCustomFields, getSetOfCustomFields, getSetOfFields, getSetOfNavigationProperties, hasCustomField, hasCustomField, rememberChangedField, resetChangedFields, setCustomField, setCustomField, toMap, toMapOfCustomFields, toMapOfNavigationProperties
public static final AttachmentSelectable ALL_FIELDS
public static final AttachmentField<UUID> ATTACHMENT_DOCUMENT_UUID
public static final AttachmentField<String> MIME_TYPE
public static final AttachmentField<String> FILE_NAME
@Nonnull public Class<Attachment> getType()
getType
in class VdmObject<Attachment>
public void setAttachmentDocumentUUID(@Nullable UUID attachmentDocumentUUID)
Original property name from the Odata EDM: AttachmentDocumentUUID
attachmentDocumentUUID
- NodeIDpublic void setMimeType(@Nullable String mimeType)
Original property name from the Odata EDM: MimeType
mimeType
- HTML content typepublic void setFileName(@Nullable String fileName)
Original property name from the Odata EDM: FileName
fileName
- Relative storage location of physical documentprotected String getEntityCollection()
VdmEntity
getEntityCollection
in class VdmEntity<Attachment>
@Nonnull protected Map<String,Object> getKey()
getKey
in class VdmObject<Attachment>
@Nonnull protected Map<String,Object> toMapOfFields()
toMapOfFields
in class VdmObject<Attachment>
protected void fromMap(Map<String,Object> inputValues)
fromMap
in class VdmObject<Attachment>
@Nonnull public static <T> AttachmentField<T> field(@Nonnull String fieldName, @Nonnull Class<T> fieldType)
T
- The type of the extension field when performing value comparisons.fieldName
- The name of the extension field as returned by the OData service.fieldType
- The Java type to use for the extension field when performing value comparisons.@Nonnull public static <T,DomainT> AttachmentField<T> field(@Nonnull String fieldName, @Nonnull TypeConverter<T,DomainT> typeConverter)
T
- The type of the extension field when performing value comparisons.DomainT
- The type of the extension field as returned by the OData service.typeConverter
- A TypeConverterfieldName
- The name of the extension field as returned by the OData service.@Nullable public HttpDestinationProperties getDestinationForFetch()
VdmEntity
getDestinationForFetch
in class VdmEntity<Attachment>
protected void setServicePathForFetch(@Nullable String servicePathForFetch)
VdmEntity
Note: Use with caution, as this can easily break the fetch call on this entity. See the interface of the corresponding service for the default service path.
setServicePathForFetch
in class VdmEntity<Attachment>
public void attachToService(@Nullable String servicePath, @Nonnull HttpDestinationProperties destination)
VdmEntity
Note: Use with caution, as this can easily break the fetch calls on this entity. See the interface of the corresponding service for the default service path.
attachToService
in class VdmEntity<Attachment>
servicePath
- Optional parameter. New service path to apply to this entity and any associated entities that were
previously fetched. If a null value is provided and the service path has never been set, then the
service path will be set to the default defined in the corresponding service interface.destination
- New destination to apply to this entity and any associated entities that were previously fetched.@Nonnull public InputStream fetchAsStream() throws com.sap.cloud.sdk.odatav2.connectivity.ODataException
/$value
path.InputStream
.com.sap.cloud.sdk.odatav2.connectivity.ODataException
- If the entity is unmanaged, i.e. it has not been retrieved using the OData VDM's services and
therefore has no ERP configuration context assigned. An entity is managed if it has been either
retrieved using the VDM's services or returned from the VDM's services as the result of a CREATE or
UPDATE call.protected String getDefaultServicePath()
VdmEntity
getDefaultServicePath
in class VdmEntity<Attachment>
protocol://hostname:port
and the OData resource name (entity set, $metadata
, etc.)public static Attachment.AttachmentBuilder builder()
@Nullable public UUID getAttachmentDocumentUUID()
Original property name from the Odata EDM: AttachmentDocumentUUID
@Nullable public String getMimeType()
Original property name from the Odata EDM: MimeType
@Nullable public String getFileName()
Original property name from the Odata EDM: FileName
public String toString()
toString
in class VdmObject<Attachment>
public boolean equals(Object o)
equals
in class VdmObject<Attachment>
protected boolean canEqual(Object other)
canEqual
in class VdmObject<Attachment>
public int hashCode()
hashCode
in class VdmObject<Attachment>
Copyright © 2020 SAP SE. All rights reserved.