Package security.whisper.javastix.bundle
Class Bundle
java.lang.Object
security.whisper.javastix.bundle.Bundle
- All Implemented Interfaces:
Serializable,BundleObject,Stix,StixCustomProperties,GenericValidation,SdoDefaultValidator
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class Bundle
extends Object
implements BundleObject
Immutable implementation of
BundleObject.
Use the builder to create immutable instances:
Bundle.builder().
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
VALIDATOR -
Method Summary
Modifier and TypeMethodDescriptionstatic Bundle.Builderbuilder()Creates a builder forBundle.static BundlecopyOf(BundleObject instance) Creates an immutable copy of aBundleObjectvalue.booleanThis instance is equal to all instances ofBundlethat have equal attribute values.Custom Properties for STIX Objects.getId()com.google.common.collect.ImmutableSet<BundleableObject> getType()inthashCode()Computes a hash code from attributes:type,id,specVersion,objects,customProperties.toString()Prints the immutable valueBundleObjectwith attribute values.final BundlewithCustomProperties(Map<String, ? extends Object> entries) Copy the current immutable object by replacing thecustomPropertiesmap with the specified map.final BundleCopy the current immutable object by setting a value for theidattribute.final BundlewithObjects(Iterable<? extends BundleableObject> elements) Copy the current immutable object with elements that replace the content ofobjects.final BundlewithObjects(BundleableObject... elements) Copy the current immutable object with elements that replace the content ofobjects.final BundlewithSpecVersion(String value) Copy the current immutable object by setting a value for thespecVersionattribute.final BundleCopy 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.validation.GenericValidation
validateEntityMethods inherited from interface security.whisper.javastix.validation.SdoDefaultValidator
validate, validateOnlyId
-
Method Details
-
getType
@JsonPropertyDescription("The type property identifies the type of STIX Object (SDO, Relationship Object, etc). The value of the type field MUST be one of the types defined by a STIX Object (e.g., indicator).") public String getType()- Specified by:
getTypein interfaceBundleObject- Returns:
- The value of the
typeattribute
-
getId
@JsonPropertyDescription("Represents identifiers across the CTI specifications. The format consists of the name of the top-level object being identified, followed by two dashes (--), followed by a UUIDv4.") public String getId()- Specified by:
getIdin interfaceBundleObject- Returns:
- The value of the
idattribute
-
getSpecVersion
@JsonPropertyDescription("The version of the STIX specification used to represent the content in this bundle.") public String getSpecVersion()- Specified by:
getSpecVersionin interfaceBundleObject- Returns:
- The value of the
specVersionattribute
-
getObjects
@JsonPropertyDescription("Specifies a set of one or more STIX Objects.") public com.google.common.collect.ImmutableSet<BundleableObject> getObjects()- Specified by:
getObjectsin interfaceBundleObject- Returns:
- The value of the
objectsattribute
-
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>
-
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
-
withId
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id (can benull)- Returns:
- A modified copy of the
thisobject
-
withSpecVersion
Copy the current immutable object by setting a value for thespecVersionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for specVersion- Returns:
- A modified copy of the
thisobject
-
withObjects
Copy the current immutable object with elements that replace the content ofobjects.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withObjects
Copy the current immutable object with elements that replace the content ofobjects. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of objects elements to set- 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 ofBundlethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:type,id,specVersion,objects,customProperties. -
toString
Prints the immutable valueBundleObjectwith attribute values. -
toJsonString
Returns a lazily initialized value of the
toJsonStringattribute. Initialized once and only once and stored for subsequent access with proper synchronization.- Specified by:
toJsonStringin interfaceBundleObject- Returns:
- A lazily initialized value of the
toJsonStringattribute
-
copyOf
Creates an immutable copy of aBundleObjectvalue. 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 BundleObject instance
-
builder
Creates a builder forBundle.- Returns:
- A new Bundle builder
-