Enum RelationshipType
- java.lang.Object
-
- java.lang.Enum<RelationshipType>
-
- software.amazon.smithy.model.neighbor.RelationshipType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<RelationshipType>
public enum RelationshipType extends java.lang.Enum<RelationshipType>
Defines the relationship types between neighboring shapes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOUND
Deprecated.COLLECTION_OPERATION
A collection operation relationship exists between a resource and the operations bound to the resource in the "collectionOperations" property.CREATE
Relationships that exist between a resource and the create lifecycle operation.DELETE
Relationships that exist between a resource and the delete lifecycle operation.ENUM_MEMBER
Relationships that exist onenum
shapes to theirmember shapes
.ERROR
Relationships that exist onoperation
shapes.ID_REF
Relationships that exist between a shape and another shape referenced by anIdRefTrait
.IDENTIFIER
Relationships that exist between amember
and the shapes that are referenced by its identifiers property.INPUT
Relationships that exist onoperation
shapes.INSTANCE_OPERATION
Deprecated.INT_ENUM_MEMBER
Relationships that exist onintEnum
shapes to theirmember shapes
.LIST
Relationships that exist between a resource and the list lifecycle operation.LIST_MEMBER
Relationships that exist onlist
shapes to theirmember shapes
.MAP_KEY
Relationships that exist onmap
shapes.MAP_VALUE
Relationships that exist onmap
shapes.MEMBER_CONTAINER
Relationships exist onmember
shapes.MEMBER_TARGET
Relationships exist onmember
shapes.MIXIN
Relationship that exists between a structure or union and a mixin applied to the shape.OPERATION
An operation relationship exists between a service and the operations bound to the service in the "operations" property, and between a resource and the operations bound to the resource in the "operations", "collectionOperations", and lifecycle properties.OUTPUT
Relationships that exist onoperation
shapes.PROPERTY
Relationships that exist between amember
and the shapes that are referenced by its properties property.PUT
Relationships that exist between a resource and the put lifecycle operation.READ
Relationships that exist between a resource and the get lifecycle operation.RESOURCE
A resource relationship exists between a service or resource and the resources bound through the "resources" property.SET_MEMBER
Deprecated.STRUCTURE_MEMBER
Relationships that exist onstructure
shapes.TRAIT
Relationships that exist between a shape and traits bound to the shape.UNION_MEMBER
Relationships that exist onunion
shapes.UPDATE
Relationships that exist between a resource and the update lifecycle operation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RelationshipDirection
getDirection()
Gets the direction of the relationship.java.util.Optional<java.lang.String>
getSelectorLabel()
Gets the token that is used inSelector
expressions when referring to the relationship or an emptyOptional
if this relationship is not used directly in a selector.boolean
isCollectionOperationBinding()
Returns true if relationship connects a resource to a collection operation.boolean
isInstanceOperationBinding()
Returns true if relationship connects a resource to an instance operation.boolean
isMemberBinding()
Checks if the given relationship connects a container shape to a member.boolean
isOperationBinding()
Checks if the binding is to an operation (create|read|update|delete|put|list|operation|collectionOperation).static RelationshipType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static RelationshipType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
RESOURCE
public static final RelationshipType RESOURCE
A resource relationship exists between a service or resource and the resources bound through the "resources" property.
-
OPERATION
public static final RelationshipType OPERATION
An operation relationship exists between a service and the operations bound to the service in the "operations" property, and between a resource and the operations bound to the resource in the "operations", "collectionOperations", and lifecycle properties.
-
COLLECTION_OPERATION
public static final RelationshipType COLLECTION_OPERATION
A collection operation relationship exists between a resource and the operations bound to the resource in the "collectionOperations" property.
-
INSTANCE_OPERATION
@Deprecated public static final RelationshipType INSTANCE_OPERATION
Deprecated.
-
BOUND
@Deprecated public static final RelationshipType BOUND
Deprecated.
-
PUT
public static final RelationshipType PUT
Relationships that exist between a resource and the put lifecycle operation.
-
CREATE
public static final RelationshipType CREATE
Relationships that exist between a resource and the create lifecycle operation.
-
READ
public static final RelationshipType READ
Relationships that exist between a resource and the get lifecycle operation.
-
UPDATE
public static final RelationshipType UPDATE
Relationships that exist between a resource and the update lifecycle operation.
-
DELETE
public static final RelationshipType DELETE
Relationships that exist between a resource and the delete lifecycle operation.
-
LIST
public static final RelationshipType LIST
Relationships that exist between a resource and the list lifecycle operation.
-
IDENTIFIER
public static final RelationshipType IDENTIFIER
Relationships that exist between amember
and the shapes that are referenced by its identifiers property.
-
PROPERTY
public static final RelationshipType PROPERTY
Relationships that exist between amember
and the shapes that are referenced by its properties property.
-
MEMBER_CONTAINER
public static final RelationshipType MEMBER_CONTAINER
Relationships exist onmember
shapes. The subject of the relationship is the member shape, and the neighbor is the aggregate shape that contains the member.
-
MEMBER_TARGET
public static final RelationshipType MEMBER_TARGET
Relationships exist onmember
shapes. The subject of the relationship is the member shape, and the neighbor is the shape that the member targets.
-
INPUT
public static final RelationshipType INPUT
-
OUTPUT
public static final RelationshipType OUTPUT
-
ERROR
public static final RelationshipType ERROR
-
ENUM_MEMBER
public static final RelationshipType ENUM_MEMBER
Relationships that exist onenum
shapes to theirmember shapes
.
-
INT_ENUM_MEMBER
public static final RelationshipType INT_ENUM_MEMBER
Relationships that exist onintEnum
shapes to theirmember shapes
.
-
LIST_MEMBER
public static final RelationshipType LIST_MEMBER
Relationships that exist onlist
shapes to theirmember shapes
.
-
SET_MEMBER
@Deprecated public static final RelationshipType SET_MEMBER
Deprecated.Relationships that exist onset
shapes to theirmember shapes
.
-
MAP_KEY
public static final RelationshipType MAP_KEY
-
MAP_VALUE
public static final RelationshipType MAP_VALUE
-
STRUCTURE_MEMBER
public static final RelationshipType STRUCTURE_MEMBER
-
UNION_MEMBER
public static final RelationshipType UNION_MEMBER
-
TRAIT
public static final RelationshipType TRAIT
Relationships that exist between a shape and traits bound to the shape. They reference shapes marked with theTraitDefinition
trait.This kind of relationship is not returned by default from a
NeighborProvider
. You must explicitly wrap aNeighborProvider
withNeighborProvider.withTraitRelationships(Model, NeighborProvider)
in order to yield trait relationships.
-
MIXIN
public static final RelationshipType MIXIN
Relationship that exists between a structure or union and a mixin applied to the shape.
-
ID_REF
public static final RelationshipType ID_REF
Relationships that exist between a shape and another shape referenced by anIdRefTrait
.This relationship is formed by applying a trait with a value containing a reference to another
ShapeId
. For example:{@code
-
-
Method Detail
-
values
public static RelationshipType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RelationshipType c : RelationshipType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RelationshipType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getSelectorLabel
public java.util.Optional<java.lang.String> getSelectorLabel()
Gets the token that is used inSelector
expressions when referring to the relationship or an emptyOptional
if this relationship is not used directly in a selector.- Returns:
- Returns the optionally present selector token for this relationship.
-
getDirection
public RelationshipDirection getDirection()
Gets the direction of the relationship.A
RelationshipDirection.DIRECTED
direction is formed from a shape that defines a reference to another shape (for example, when a resource defines operations or resources it contains).A
RelationshipDirection.INVERTED
relationship is a relationship from a shape to a shape that defines a relationship to it. The target of such a relationship doesn't define the relationship, but is the target of the relationship.- Returns:
- Returns the direction of the relationship.
-
isMemberBinding
public boolean isMemberBinding()
Checks if the given relationship connects a container shape to a member.- Returns:
- Returns true if a member.
-
isOperationBinding
public boolean isOperationBinding()
Checks if the binding is to an operation (create|read|update|delete|put|list|operation|collectionOperation).- Returns:
- Returns true if the binding is for any kind of operation binding.
-
isInstanceOperationBinding
public boolean isInstanceOperationBinding()
Returns true if relationship connects a resource to an instance operation.- Returns:
- True if an instance operation.
-
isCollectionOperationBinding
public boolean isCollectionOperationBinding()
Returns true if relationship connects a resource to a collection operation.- Returns:
- True if a collection operation.
-
-