Class ExternalReference
java.lang.Object
security.whisper.javastix.sdo.types.ExternalReference
- All Implemented Interfaces:
Serializable,StixCustomProperties,ExternalReferenceType,GenericValidation,SdoDefaultValidator
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ExternalReference
extends Object
implements ExternalReferenceType
external-reference
External references are used to describe pointers to information represented outside of STIX.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
VALIDATOR -
Method Summary
Modifier and TypeMethodDescriptionstatic ExternalReference.Builderbuilder()Creates a builder forExternalReference.static ExternalReferencecopyOf(ExternalReferenceType instance) Creates an immutable copy of aExternalReferenceTypevalue.booleanThis instance is equal to all instances ofExternalReferencethat have equal attribute values.Custom Properties for STIX Objects.getUrl()inthashCode()Computes a hash code from attributes:sourceName,description,url,hashes,externalId,customProperties.toString()Prints the immutable valueExternalReferencewith attribute values.final ExternalReferencewithCustomProperties(Map<String, ? extends Object> entries) Copy the current immutable object by replacing thecustomPropertiesmap with the specified map.final ExternalReferencewithDescription(String value) Copy the current immutable object by setting a present value for the optionaldescriptionattribute.final ExternalReferencewithDescription(Optional<String> optional) Copy the current immutable object by setting an optional value for thedescriptionattribute.final ExternalReferencewithExternalId(String value) Copy the current immutable object by setting a present value for the optionalexternalIdattribute.final ExternalReferencewithExternalId(Optional<String> optional) Copy the current immutable object by setting an optional value for theexternalIdattribute.final ExternalReferencewithHashes(Map<String, ? extends String> entries) Copy the current immutable object by replacing thehashesmap with the specified map.final ExternalReferencewithSourceName(String value) Copy the current immutable object by setting a value for thesourceNameattribute.final ExternalReferenceCopy the current immutable object by setting a present value for the optionalurlattribute.final ExternalReferenceCopy the current immutable object by setting an optional value for theurlattribute.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
-
getSourceName
@JsonPropertyDescription("The source within which the external-reference is defined (system, registry, organization, etc.)") public String getSourceName()- Specified by:
getSourceNamein interfaceExternalReferenceType- Returns:
- The value of the
sourceNameattribute
-
getDescription
- Specified by:
getDescriptionin interfaceExternalReferenceType- Returns:
- The value of the
descriptionattribute
-
getUrl
@JsonPropertyDescription("Matches the elements of a URL using a regular expression. Uses Diego Perini\'s regex from https://gist.github.com/dperini/729294.") public Optional<String> getUrl()- Specified by:
getUrlin interfaceExternalReferenceType- Returns:
- The value of the
urlattribute
-
getHashes
@JsonPropertyDescription("Specifies a dictionary of hashes for the file.") public com.google.common.collect.ImmutableMap<String,String> getHashes()- Specified by:
getHashesin interfaceExternalReferenceType- Returns:
- The value of the
hashesattribute
-
getExternalId
@JsonPropertyDescription("An identifier for the external reference content") public Optional<String> getExternalId()- Specified by:
getExternalIdin interfaceExternalReferenceType- Returns:
- The value of the
externalIdattribute
-
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>
-
withSourceName
Copy the current immutable object by setting a value for thesourceNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sourceName (can benull)- Returns:
- A modified copy of the
thisobject
-
withDescription
Copy the current immutable object by setting a present value for the optionaldescriptionattribute.- Parameters:
value- The value for description- Returns:
- A modified copy of
thisobject
-
withDescription
Copy the current immutable object by setting an optional value for thedescriptionattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for description- Returns:
- A modified copy of
thisobject
-
withUrl
Copy the current immutable object by setting a present value for the optionalurlattribute.- Parameters:
value- The value for url- Returns:
- A modified copy of
thisobject
-
withUrl
Copy the current immutable object by setting an optional value for theurlattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for url- Returns:
- A modified copy of
thisobject
-
withHashes
Copy the current immutable object by replacing thehashesmap 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 hashes map- Returns:
- A modified copy of
thisobject
-
withExternalId
Copy the current immutable object by setting a present value for the optionalexternalIdattribute.- Parameters:
value- The value for externalId- Returns:
- A modified copy of
thisobject
-
withExternalId
Copy the current immutable object by setting an optional value for theexternalIdattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for externalId- 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 ofExternalReferencethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:sourceName,description,url,hashes,externalId,customProperties. -
toString
Prints the immutable valueExternalReferencewith attribute values. -
copyOf
Creates an immutable copy of aExternalReferenceTypevalue. 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 ExternalReference instance
-
builder
Creates a builder forExternalReference.- Returns:
- A new ExternalReference builder
-