KeywordSet#

class stixcore.soop.manager.KeywordSet(s=None)[source]#

Bases: object

Helper object to collect and combine HeaderKeyword.

Methods Summary

add(element)

Add a new HeaderKeyword to the collection.

append(elements)

Add a list of HeaderKeyword to the collection.

get(element)

Get the given keyword from the collection.

to_list()

Get all keywords.

Methods Documentation

add(element)[source]#

Add a new HeaderKeyword to the collection.

If a same HeaderKeyword is already present than the new keywords gets combined into the old.

Parameters:

element (HeaderKeyword) – the new keyword to add

append(elements)[source]#

Add a list of HeaderKeyword to the collection.

If a same HeaderKeyword is already present than the new keywords gets combined into the old.

Parameters:

elements (Iterable<HeaderKeyword>) – the new keywords to add

get(element)[source]#

Get the given keyword from the collection.

Parameters:

element (HeaderKeyword) – a prototype keyword that should be return with the same name.

Returns:

HeaderKeyword – The found keyword with the same name.

to_list()[source]#

Get all keywords.

Returns:

list – list of all keywords