Class EmailMessage
java.lang.Object
security.whisper.javastix.coo.objects.EmailMessage
- All Implemented Interfaces:
Serializable,BundleableObject,Stix,StixCustomProperties,CyberObservableObject,CyberObservableObjectCommonProperties,EmailMessageCoo,GenericValidation,SdoDefaultValidator
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class EmailMessage
extends Object
implements EmailMessageCoo
The Email Message Object represents an instance of an email message.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
VALIDATOR -
Method Summary
Modifier and TypeMethodDescriptionstatic EmailMessage.Builderbuilder()Creates a builder forEmailMessage.static EmailMessagecopyOf(EmailMessageCoo instance) Creates an immutable copy of aEmailMessageCoovalue.booleanThis instance is equal to all instances ofEmailMessagethat have equal attribute values.Custom Properties for STIX Objects.getDate()Indicates whether the data contained in the SCO has been defanged.com.google.common.collect.ImmutableSet<CyberObservableExtension> Multiple extensions can be added, but only 1 instance of a specific extension can be added.com.google.common.collect.ImmutableSet<GranularMarkingDm> booleangetId()Deterministically generates the ID for this email message based on its subject, from, date, and content.com.google.common.collect.ImmutableSet<MarkingDefinitionDm> Used for generation of Map Keys byManually set this value if you want to control key names.invalid reference
ObservedDataSdo#getObjects()getType()inthashCode()Computes a hash code from attributes:isMultipart,date,contentType,fromRef,senderRef,id,type,extensions,observableObjectKey,defanged,customProperties,objectMarkingRefs,granularMarkings,hydrated,toJsonString.toString()Prints the immutable valueEmailMessagewith attribute values.final EmailMessagewithContentType(String value) Copy the current immutable object by setting a present value for the optionalcontentTypeattribute.final EmailMessagewithContentType(Optional<String> optional) Copy the current immutable object by setting an optional value for thecontentTypeattribute.final EmailMessagewithCustomProperties(Map<String, ? extends Object> entries) Copy the current immutable object by replacing thecustomPropertiesmap with the specified map.final EmailMessagewithDate(Optional<? extends StixInstant> optional) Copy the current immutable object by setting an optional value for thedateattribute.final EmailMessagewithDate(StixInstant value) Copy the current immutable object by setting a present value for the optionaldateattribute.final EmailMessagewithDefanged(boolean value) Copy the current immutable object by setting a present value for the optionaldefangedattribute.final EmailMessagewithDefanged(Optional<Boolean> optional) Copy the current immutable object by setting an optional value for thedefangedattribute.final EmailMessagewithExtensions(Iterable<? extends CyberObservableExtension> elements) Copy the current immutable object with elements that replace the content ofextensions.final EmailMessagewithExtensions(CyberObservableExtension... elements) Copy the current immutable object with elements that replace the content ofextensions.final EmailMessagewithFromRef(String value) Copy the current immutable object by setting a present value for the optionalfromRefattribute.final EmailMessagewithFromRef(Optional<String> optional) Copy the current immutable object by setting an optional value for thefromRefattribute.final EmailMessagewithGranularMarkings(Iterable<? extends GranularMarkingDm> elements) Copy the current immutable object with elements that replace the content ofgranularMarkings.final EmailMessagewithGranularMarkings(GranularMarkingDm... elements) Copy the current immutable object with elements that replace the content ofgranularMarkings.final EmailMessagewithHydrated(boolean value) Copy the current immutable object by setting a value for thehydratedattribute.final EmailMessagewithIsMultipart(Boolean value) Copy the current immutable object by setting a value for theisMultipartattribute.final EmailMessagewithObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements) Copy the current immutable object with elements that replace the content ofobjectMarkingRefs.final EmailMessagewithObjectMarkingRefs(MarkingDefinitionDm... elements) Copy the current immutable object with elements that replace the content ofobjectMarkingRefs.final EmailMessagewithObservableObjectKey(String value) Copy the current immutable object by setting a value for theobservableObjectKeyattribute.final EmailMessagewithSenderRef(String value) Copy the current immutable object by setting a present value for the optionalsenderRefattribute.final EmailMessagewithSenderRef(Optional<String> optional) Copy the current immutable object by setting an optional value for thesenderRefattribute.final EmailMessagewithToJsonString(String value) Copy the current immutable object by setting a value for thetoJsonStringattribute.final EmailMessageCopy the current immutable object by setting a value for thetypeattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface security.whisper.javastix.coo.objects.EmailMessageCoo
getAdditionalHeaderFields, getBccRefs, getBody, getBodyMultipart, getCcRefs, getRawEmailRef, getReceivedLines, getSubject, getToRefsMethods inherited from interface security.whisper.javastix.validation.GenericValidation
validateEntityMethods inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
validate, validateOnlyId
-
Method Details
-
isMultipart
@JsonPropertyDescription("Indicates whether the email body contains multiple MIME parts.") public Boolean isMultipart()- Specified by:
isMultipartin interfaceEmailMessageCoo- Returns:
- The value of the
isMultipartattribute
-
getDate
@JsonPropertyDescription("Specifies the date/time that the email message was sent.") public Optional<StixInstant> getDate()- Specified by:
getDatein interfaceEmailMessageCoo- Returns:
- The value of the
dateattribute
-
getContentType
@JsonPropertyDescription("Specifies the value of the \'Content-Type\' header of the email message.") public Optional<String> getContentType()- Specified by:
getContentTypein interfaceEmailMessageCoo- Returns:
- The value of the
contentTypeattribute
-
getFromRef
@JsonPropertyDescription("Specifies the value of the \'From:\' header of the email message.") public Optional<String> getFromRef()- Specified by:
getFromRefin interfaceEmailMessageCoo- Returns:
- The value of the
fromRefattribute
-
getSenderRef
@JsonPropertyDescription("Specifies the value of the \'From\' field of the email message") public Optional<String> getSenderRef()- Specified by:
getSenderRefin interfaceEmailMessageCoo- Returns:
- The value of the
senderRefattribute
-
getId
Deterministically generates the ID for this email message based on its subject, from, date, and content.- Specified by:
getIdin interfaceBundleableObject- Specified by:
getIdin interfaceCyberObservableObjectCommonProperties- Specified by:
getIdin interfaceEmailMessageCoo
-
getType
- Specified by:
getTypein interfaceBundleableObject- Specified by:
getTypein interfaceCyberObservableObjectCommonProperties- Returns:
- The value of the
typeattribute
-
getExtensions
@JsonPropertyDescription("Specifies any extensions of the object, as a dictionary.") public com.google.common.collect.ImmutableSet<CyberObservableExtension> getExtensions()Multiple extensions can be added, but only 1 instance of a specific extension can be added.- Specified by:
getExtensionsin interfaceCyberObservableObjectCommonProperties
-
getObservableObjectKey
Used for generation of Map Keys byManually set this value if you want to control key names. Otherwise UUIDs will be used.invalid reference
ObservedDataSdo#getObjects()- Specified by:
getObservableObjectKeyin interfaceCyberObservableObjectCommonProperties
-
getDefanged
@JsonPropertyDescription("Indicates whether the data contained in the SCO has been defanged.") public Optional<Boolean> getDefanged()Indicates whether the data contained in the SCO has been defanged. Defanging refers to the process of modifying data to make it safe to handle (e.g., changing an IP address from 192.168.1.1 to 192[.]168[.]1[.]1).- Specified by:
getDefangedin interfaceCyberObservableObjectCommonProperties
-
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>
-
getObjectMarkingRefs
- Specified by:
getObjectMarkingRefsin interfaceBundleableObject- Returns:
- The value of the
objectMarkingRefsattribute
-
getGranularMarkings
- Specified by:
getGranularMarkingsin interfaceBundleableObject- Returns:
- The value of the
granularMarkingsattribute
-
getHydrated
public boolean getHydrated()- Specified by:
getHydratedin interfaceBundleableObject- Returns:
- The value of the
hydratedattribute
-
toJsonString
- Specified by:
toJsonStringin interfaceBundleableObject- Returns:
- The value of the
toJsonStringattribute
-
withIsMultipart
Copy the current immutable object by setting a value for theisMultipartattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for isMultipart (can benull)- Returns:
- A modified copy of the
thisobject
-
withDate
Copy the current immutable object by setting a present value for the optionaldateattribute.- Parameters:
value- The value for date- Returns:
- A modified copy of
thisobject
-
withDate
Copy the current immutable object by setting an optional value for thedateattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for date- 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
-
withFromRef
Copy the current immutable object by setting a present value for the optionalfromRefattribute.- Parameters:
value- The value for fromRef- Returns:
- A modified copy of
thisobject
-
withFromRef
Copy the current immutable object by setting an optional value for thefromRefattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for fromRef- Returns:
- A modified copy of
thisobject
-
withSenderRef
Copy the current immutable object by setting a present value for the optionalsenderRefattribute.- Parameters:
value- The value for senderRef- Returns:
- A modified copy of
thisobject
-
withSenderRef
Copy the current immutable object by setting an optional value for thesenderRefattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for senderRef- Returns:
- A modified copy of
thisobject
-
withType
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
withExtensions
Copy the current immutable object with elements that replace the content ofextensions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withExtensions
Copy the current immutable object with elements that replace the content ofextensions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of extensions elements to set- Returns:
- A modified copy of
thisobject
-
withObservableObjectKey
Copy the current immutable object by setting a value for theobservableObjectKeyattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for observableObjectKey- Returns:
- A modified copy of the
thisobject
-
withDefanged
Copy the current immutable object by setting a present value for the optionaldefangedattribute.- Parameters:
value- The value for defanged- Returns:
- A modified copy of
thisobject
-
withDefanged
Copy the current immutable object by setting an optional value for thedefangedattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for defanged- 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
-
withObjectMarkingRefs
Copy the current immutable object with elements that replace the content ofobjectMarkingRefs.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withObjectMarkingRefs
Copy the current immutable object with elements that replace the content ofobjectMarkingRefs. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of objectMarkingRefs elements to set- Returns:
- A modified copy of
thisobject
-
withGranularMarkings
Copy the current immutable object with elements that replace the content ofgranularMarkings.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withGranularMarkings
Copy the current immutable object with elements that replace the content ofgranularMarkings. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of granularMarkings elements to set- Returns:
- A modified copy of
thisobject
-
withHydrated
Copy the current immutable object by setting a value for thehydratedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hydrated- Returns:
- A modified copy of the
thisobject
-
withToJsonString
Copy the current immutable object by setting a value for thetoJsonStringattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for toJsonString (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofEmailMessagethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:isMultipart,date,contentType,fromRef,senderRef,id,type,extensions,observableObjectKey,defanged,customProperties,objectMarkingRefs,granularMarkings,hydrated,toJsonString. -
toString
Prints the immutable valueEmailMessagewith attribute values. -
copyOf
Creates an immutable copy of aEmailMessageCoovalue. 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 EmailMessage instance
-
builder
Creates a builder forEmailMessage.- Returns:
- A new EmailMessage builder
-