public final class OptionContainerUtils extends Object
public static Descriptor createPrimaryType(Repository.UnitOfWork transaction, OptionContainer container, Descriptor primaryType) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container (cannot be null
)primaryType
- the primary type descriptor (cannot be null
)null
)KException
- if an error occurspublic static StatementOption[] getCustomOptions(Repository.UnitOfWork transaction, OptionContainer container) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose custom options are being requested (cannot be null
)null
but can be empty)KException
- if an error occurspublic static String getOption(Repository.UnitOfWork transaction, OptionContainer container, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose statement option value is being requested (cannot be null
)name
- the name of the statement option whose value is being requested (cannot be empty)null
if not foundKException
- if an error occurspublic static String[] getOptionNames(Repository.UnitOfWork transaction, OptionContainer container) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose custom option names are being requested (cannot be null
)null
but can be empty)KException
- if an error occurspublic static StatementOption[] getOptions(Repository.UnitOfWork transaction, OptionContainer container) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose options are being requested (cannot be null
)null
but can be empty)KException
- if an error occurspublic static Property getProperty(Repository.UnitOfWork transaction, OptionContainer container, String name, Property property) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose property or statement option is being requested (cannot be null
)name
- the name of the property or statement option being requested (cannot be empty)property
- the property with the given name or null
if it does not existnull
if not foundKException
- if an error occurspublic static PropertyDescriptor getPropertyDescriptor(Repository.UnitOfWork transaction, OptionContainer container, String name, PropertyDescriptor descriptor) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose property or statement option descriptor is being requested (cannot be null
)name
- the name of the property or statement option whose descriptor is being requested (cannot be empty)descriptor
- the property descriptor with the given name or null
if it does not existnull
if not foundKException
- if an error occurspublic static String[] getPropertyNames(Repository.UnitOfWork transaction, OptionContainer container, String[] propNames) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose property or statement option descriptor is being requested (cannot be null
)propNames
- the names of the properties that have values (cannot be null
)null
)KException
- if an error occurspublic static StatementOption getStatementOption(Repository.UnitOfWork transaction, OptionContainer container, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose statement option is being requested (cannot be null
)name
- the name of the statement option being requested (cannot be empty)null
if not foundKException
- if an error occurspublic static boolean hasCustomOption(Repository.UnitOfWork transaction, OptionContainer container, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))container
- the option container being checked (cannot be null
)name
- the name the custom statement option whose existence is being checked (cannot be empty)true
if the custom statement option existsKException
- if an error occurspublic static boolean hasOption(Repository.UnitOfWork transaction, OptionContainer container, String name) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))container
- the option container being checked (cannot be null
)name
- the name the property or statement option whose existence is being checked (cannot be empty)true
if a property or statement option with the supplied name existsKException
- if an error occurspublic static boolean hasOptions(Repository.UnitOfWork transaction, OptionContainer container) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))container
- the option container being checked (cannot be null
)true
if statement options existKException
- if an error occurspublic static boolean hasProperties(Repository.UnitOfWork transaction, OptionContainer container, boolean propertiesExist) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))container
- the option container being checked (cannot be null
)propertiesExist
- true
if container has propertiestrue
if properties or statement options existKException
- if an error occurspublic static boolean hasProperty(Repository.UnitOfWork transaction, OptionContainer container, String name, boolean propertyExists) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
))container
- the option container being checked (cannot be null
)name
- the name of the property or statement option (cannot be empty)propertyExists
- true
if container has the specified propertytrue
if a property or statement options with the specified name existsKException
- if an error occurspublic static void removeOption(Repository.UnitOfWork transaction, OptionContainer container, String optionToRemove) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose option is being removed (cannot be null
)optionToRemove
- the name of the statement option being removed (cannot be empty)KException
- if an error occurspublic static StatementOption setOption(Repository.UnitOfWork transaction, OptionContainer container, String optionName, String optionValue) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose option is being set (cannot be null
)optionName
- the name of the statement option being added (cannot be empty)optionValue
- the statement option value (can be empty if removing the option)null
if removed)KException
- if an error occurspublic static boolean setProperty(Repository.UnitOfWork transaction, OptionContainer container, String propertyName, Object... values) throws KException
transaction
- the transaction (cannot be null
or have a state that is not Repository.UnitOfWork.State.NOT_STARTED
)container
- the option container whose option is being set (cannot be null
)propertyName
- the name of the option (cannot be empty)values
- the new values (can be null
)true
if an option was setKException
- if an error occursCopyright © 2013–2019. All rights reserved.