71 lines
1.9 KiB
C++
71 lines
1.9 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/dynamodb/model/ConditionalOperator.h>
|
|||
|
|
#include <aws/core/utils/HashingUtils.h>
|
|||
|
|
#include <aws/core/Globals.h>
|
|||
|
|
#include <aws/core/utils/EnumParseOverflowContainer.h>
|
|||
|
|
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace Aws
|
|||
|
|
{
|
|||
|
|
namespace DynamoDB
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
namespace ConditionalOperatorMapper
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
static const int AND_HASH = HashingUtils::HashString("AND");
|
|||
|
|
static const int OR_HASH = HashingUtils::HashString("OR");
|
|||
|
|
|
|||
|
|
|
|||
|
|
ConditionalOperator GetConditionalOperatorForName(const Aws::String& name)
|
|||
|
|
{
|
|||
|
|
int hashCode = HashingUtils::HashString(name.c_str());
|
|||
|
|
if (hashCode == AND_HASH)
|
|||
|
|
{
|
|||
|
|
return ConditionalOperator::AND;
|
|||
|
|
}
|
|||
|
|
else if (hashCode == OR_HASH)
|
|||
|
|
{
|
|||
|
|
return ConditionalOperator::OR;
|
|||
|
|
}
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
overflowContainer->StoreOverflow(hashCode, name);
|
|||
|
|
return static_cast<ConditionalOperator>(hashCode);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return ConditionalOperator::NOT_SET;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String GetNameForConditionalOperator(ConditionalOperator enumValue)
|
|||
|
|
{
|
|||
|
|
switch(enumValue)
|
|||
|
|
{
|
|||
|
|
case ConditionalOperator::AND:
|
|||
|
|
return "AND";
|
|||
|
|
case ConditionalOperator::OR:
|
|||
|
|
return "OR";
|
|||
|
|
default:
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace ConditionalOperatorMapper
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace DynamoDB
|
|||
|
|
} // namespace Aws
|