Class AwsClientNullableIndex
java.lang.Object
software.amazon.smithy.model.knowledge.NullableIndex
software.amazon.smithy.aws.traits.AwsClientNullableIndex
- All Implemented Interfaces:
software.amazon.smithy.model.knowledge.KnowledgeIndex
public final class AwsClientNullableIndex
extends software.amazon.smithy.model.knowledge.NullableIndex
Checks if a member is nullable by taking into account the
ClientOptionalTrait
and base logic of NullableIndex.
This index extends from NullableIndex
so that code generators
that need to conditionally honor the ClientOptionalTrait
can
choose which specific NullableIndex they use during codegen.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isMemberOptional
(software.amazon.smithy.model.shapes.MemberShape member) Checks if the given member should be generated as optional by an AWS client that respects theClientOptionalTrait
and the base rules of Smithy'sNullableIndex
.static AwsClientNullableIndex
of
(software.amazon.smithy.model.Model model) Methods inherited from class software.amazon.smithy.model.knowledge.NullableIndex
isNullable
-
Constructor Details
-
AwsClientNullableIndex
public AwsClientNullableIndex(software.amazon.smithy.model.Model model)
-
-
Method Details
-
of
-
isMemberOptional
public boolean isMemberOptional(software.amazon.smithy.model.shapes.MemberShape member) Checks if the given member should be generated as optional by an AWS client that respects theClientOptionalTrait
and the base rules of Smithy'sNullableIndex
.- Overrides:
isMemberOptional
in classsoftware.amazon.smithy.model.knowledge.NullableIndex
- Parameters:
member
- Member to check.- Returns:
- Returns true if the shape should be optional in generated clients.
-