Class ProtocolsTrait
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTrait
-
- software.amazon.smithy.model.traits.ProtocolsTrait
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToShapeId
,Trait
,software.amazon.smithy.utils.ToSmithyBuilder<ProtocolsTrait>
public final class ProtocolsTrait extends AbstractTrait implements software.amazon.smithy.utils.ToSmithyBuilder<ProtocolsTrait>
Defines the protocols supported by a service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProtocolsTrait.Builder
Builds the protocols trait.static class
ProtocolsTrait.Provider
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtocolsTrait.Builder
builder()
protected Node
createNode()
The result of toNode is used for hashCodes and equality.java.util.Set<java.lang.String>
getAllAuthSchemes()
Gets a set of all the authentication schemes listed in each protocol.java.util.Optional<Protocol>
getProtocol(java.lang.String name)
Gets a protocol by name.java.util.List<java.lang.String>
getProtocolNames()
Gets the list of protocol names.java.util.List<Protocol>
getProtocols()
Gets the list of protocols.boolean
hasProtocol(java.lang.String name)
Checks if the trait contains a protocol of the given name.ProtocolsTrait.Builder
toBuilder()
-
Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, toNode, toShapeId, toString
-
-
-
-
Field Detail
-
ID
public static final ShapeId ID
-
NONE_AUTH
public static final java.lang.String NONE_AUTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProtocols
public java.util.List<Protocol> getProtocols()
Gets the list of protocols.- Returns:
- Returns the protocols
-
getProtocolNames
public java.util.List<java.lang.String> getProtocolNames()
Gets the list of protocol names.- Returns:
- Returns the list of supported protocol names.
-
getProtocol
public java.util.Optional<Protocol> getProtocol(java.lang.String name)
Gets a protocol by name.- Parameters:
name
- Name of the protocol to get.- Returns:
- Returns the optionally found protocol.
-
hasProtocol
public boolean hasProtocol(java.lang.String name)
Checks if the trait contains a protocol of the given name.- Parameters:
name
- Name of the protocol to check.- Returns:
- Returns true if the protocol exists for this name.
-
getAllAuthSchemes
public java.util.Set<java.lang.String> getAllAuthSchemes()
Gets a set of all the authentication schemes listed in each protocol.Iteration over the returned set provides priority order based on the order of the protocol followed by the order of the auth entry in a protocols list.
- Returns:
- Returns all supported authentication schemes.
-
createNode
protected Node createNode()
Description copied from class:AbstractTrait
The result of toNode is used for hashCodes and equality. Subclasses must implement createNode to turn the trait into a Node. This is then cached for subsequent retrievals.- Specified by:
createNode
in classAbstractTrait
- Returns:
- Returns the trait as a node.
-
toBuilder
public ProtocolsTrait.Builder toBuilder()
- Specified by:
toBuilder
in interfacesoftware.amazon.smithy.utils.ToSmithyBuilder<ProtocolsTrait>
-
builder
public static ProtocolsTrait.Builder builder()
- Returns:
- Returns an protocols trait builder.
-
-