78 lines
2.3 KiB
C++
78 lines
2.3 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/budgets/model/ComparisonOperator.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 Budgets
|
|
{
|
|
namespace Model
|
|
{
|
|
namespace ComparisonOperatorMapper
|
|
{
|
|
|
|
static const int GREATER_THAN_HASH = HashingUtils::HashString("GREATER_THAN");
|
|
static const int LESS_THAN_HASH = HashingUtils::HashString("LESS_THAN");
|
|
static const int EQUAL_TO_HASH = HashingUtils::HashString("EQUAL_TO");
|
|
|
|
|
|
ComparisonOperator GetComparisonOperatorForName(const Aws::String& name)
|
|
{
|
|
int hashCode = HashingUtils::HashString(name.c_str());
|
|
if (hashCode == GREATER_THAN_HASH)
|
|
{
|
|
return ComparisonOperator::GREATER_THAN;
|
|
}
|
|
else if (hashCode == LESS_THAN_HASH)
|
|
{
|
|
return ComparisonOperator::LESS_THAN;
|
|
}
|
|
else if (hashCode == EQUAL_TO_HASH)
|
|
{
|
|
return ComparisonOperator::EQUAL_TO;
|
|
}
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|
if(overflowContainer)
|
|
{
|
|
overflowContainer->StoreOverflow(hashCode, name);
|
|
return static_cast<ComparisonOperator>(hashCode);
|
|
}
|
|
|
|
return ComparisonOperator::NOT_SET;
|
|
}
|
|
|
|
Aws::String GetNameForComparisonOperator(ComparisonOperator enumValue)
|
|
{
|
|
switch(enumValue)
|
|
{
|
|
case ComparisonOperator::GREATER_THAN:
|
|
return "GREATER_THAN";
|
|
case ComparisonOperator::LESS_THAN:
|
|
return "LESS_THAN";
|
|
case ComparisonOperator::EQUAL_TO:
|
|
return "EQUAL_TO";
|
|
default:
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|
if(overflowContainer)
|
|
{
|
|
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
|
|
}
|
|
|
|
return {};
|
|
}
|
|
}
|
|
|
|
} // namespace ComparisonOperatorMapper
|
|
} // namespace Model
|
|
} // namespace Budgets
|
|
} // namespace Aws
|