[#BloombergLP-baljsn-EncodeImplUtil-validate-06] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/EncodeImplUtil.adoc[EncodeImplUtil]::validate :relfileprefix: ../../../ :mrdocs: Determine whether `value` meets the encoding requirements for `category`. == Synopsis Declared in `<baljsn_encodeimplutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> static int validate( std::ostream* logStream, TYPE const& value, xref:BloombergLP/bdlat_TypeCategory/Choice.adoc[bdlat_TypeCategory::Choice] category); ---- == Description Determine if the specified `value` having the specified `bdlat` `category` satisfies the requirements for encoding using this component. If the `value` meets the encoding requirements, return 0, otherwise load an unspecified, human‐readable description of the requirements that are not satisfied by the `value` and return a non‐zero value. For values satisfying the `bdlat` `Choice` type‐category concept, the value of the `selectionId` attribute must not be undefined. For values satisfying the requirements of other `bdlat` type‐category concepts, there are no further requirements for encoding using this component. See the package‐level documentation of `bdlat` for an introduction to the requirements of `bdlat` type‐category concepts. == Return Value 0 if valid, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *logStream* | stream for human‐readable error descriptions | *value* | value to validate for encoding | *category* | `bdlat` Choice type‐category tag |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#