Class MimePartType
java.lang.Object
security.whisper.javastix.coo.types.MimePartType
- All Implemented Interfaces:
Serializable,StixCustomProperties,MimePartTypeObj,GenericValidation,SdoDefaultValidator
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class MimePartType
extends Object
implements MimePartTypeObj
Specifies a component of a multi-part email body.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
VALIDATOR -
Method Summary
Modifier and TypeMethodDescriptionstatic MimePartType.Builderbuilder()Creates a builder forMimePartType.static MimePartTypecopyOf(MimePartTypeObj instance) Creates an immutable copy of aMimePartTypeObjvalue.booleanThis instance is equal to all instances ofMimePartTypethat have equal attribute values.getBody()Contents of body MUST be decoded to Unicode.The object referenced in this property MUST be of type artifact or file.Any additional “Content-Type” header field parameters such as charset SHOULD be included in this property.Custom Properties for STIX Objects.inthashCode()Computes a hash code from attributes:body,bodyRawRef,contentType,contentDisposition,customProperties.toString()Prints the immutable valueMimePartTypewith attribute values.final MimePartTypeCopy the current immutable object by setting a present value for the optionalbodyattribute.final MimePartTypeCopy the current immutable object by setting an optional value for thebodyattribute.final MimePartTypewithBodyRawRef(String value) Copy the current immutable object by setting a present value for the optionalbodyRawRefattribute.final MimePartTypewithBodyRawRef(Optional<String> optional) Copy the current immutable object by setting an optional value for thebodyRawRefattribute.final MimePartTypewithContentDisposition(String value) Copy the current immutable object by setting a present value for the optionalcontentDispositionattribute.final MimePartTypewithContentDisposition(Optional<String> optional) Copy the current immutable object by setting an optional value for thecontentDispositionattribute.final MimePartTypewithContentType(String value) Copy the current immutable object by setting a present value for the optionalcontentTypeattribute.final MimePartTypewithContentType(Optional<String> optional) Copy the current immutable object by setting an optional value for thecontentTypeattribute.final MimePartTypewithCustomProperties(Map<String, ? extends Object> entries) Copy the current immutable object by replacing thecustomPropertiesmap with the specified map.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface security.whisper.javastix.validation.GenericValidation
validateEntityMethods inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
validate, validateOnlyId
-
Method Details
-
getBody
@JsonPropertyDescription("Specifies the contents of the MIME part if the content_type is not provided OR starts with text/") public Optional<String> getBody()Contents of body MUST be decoded to Unicode.- Specified by:
getBodyin interfaceMimePartTypeObj
-
getBodyRawRef
@JsonPropertyDescription("Specifies the contents of non-textual MIME parts, that is those whose content_type does not start with text/") public Optional<String> getBodyRawRef()The object referenced in this property MUST be of type artifact or file. For use cases where conveying the actual data contained in the MIME part is of primary importance, artifact SHOULD be used. Otherwise, for use cases where conveying metadata about the file-like properties of the MIME part is of primary importance, file SHOULD be used.- Specified by:
getBodyRawRefin interfaceMimePartTypeObj
-
getContentType
@JsonPropertyDescription("Specifies the value of the \'Content-Type\' header field of the MIME part.") public Optional<String> getContentType()Any additional “Content-Type” header field parameters such as charset SHOULD be included in this property.- Specified by:
getContentTypein interfaceMimePartTypeObj
-
getContentDisposition
@JsonPropertyDescription("Specifies the value of the \'Content-Disposition\' header field of the MIME part.") public Optional<String> getContentDisposition()- Specified by:
getContentDispositionin interfaceMimePartTypeObj- Returns:
- The value of the
contentDispositionattribute
-
getCustomProperties
Custom Properties for STIX Objects. Any object that supports custom properties will have a validation of the custom property prefix (typically "x_"). If the additional property in the JSON does not meet the StartsWith condition, then the JSON will be rejected.- Specified by:
getCustomPropertiesin interfaceStixCustomProperties- Returns:
- Map of custom properties
Map<String, Object>
-
withBody
Copy the current immutable object by setting a present value for the optionalbodyattribute.- Parameters:
value- The value for body- Returns:
- A modified copy of
thisobject
-
withBody
Copy the current immutable object by setting an optional value for thebodyattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for body- Returns:
- A modified copy of
thisobject
-
withBodyRawRef
Copy the current immutable object by setting a present value for the optionalbodyRawRefattribute.- Parameters:
value- The value for bodyRawRef- Returns:
- A modified copy of
thisobject
-
withBodyRawRef
Copy the current immutable object by setting an optional value for thebodyRawRefattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for bodyRawRef- Returns:
- A modified copy of
thisobject
-
withContentType
Copy the current immutable object by setting a present value for the optionalcontentTypeattribute.- Parameters:
value- The value for contentType- Returns:
- A modified copy of
thisobject
-
withContentType
Copy the current immutable object by setting an optional value for thecontentTypeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for contentType- Returns:
- A modified copy of
thisobject
-
withContentDisposition
Copy the current immutable object by setting a present value for the optionalcontentDispositionattribute.- Parameters:
value- The value for contentDisposition- Returns:
- A modified copy of
thisobject
-
withContentDisposition
Copy the current immutable object by setting an optional value for thecontentDispositionattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for contentDisposition- Returns:
- A modified copy of
thisobject
-
withCustomProperties
Copy the current immutable object by replacing thecustomPropertiesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the customProperties map- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofMimePartTypethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:body,bodyRawRef,contentType,contentDisposition,customProperties. -
toString
Prints the immutable valueMimePartTypewith attribute values. -
copyOf
Creates an immutable copy of aMimePartTypeObjvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable MimePartType instance
-
builder
Creates a builder forMimePartType.- Returns:
- A new MimePartType builder
-