Class TraitDefinition
java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.model.traits.TraitDefinition
- All Implemented Interfaces:
- FromSourceLocation,- ToNode,- ToShapeId,- Trait,- ToSmithyBuilder<TraitDefinition>
public final class TraitDefinition
extends AbstractTrait
implements ToSmithyBuilder<TraitDefinition>
Trait definition trait.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classRepresents an individual trait diff rule to define backward compatibility rules.static final classBuilder to create a TraitDefinition.static enumstatic final classstatic enumThe structural exclusion semantics of the trait.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic TraitDefinition.Builderbuilder()protected NodeThe result of toNode is used for hashCodes and equality.booleanGets the trait names that conflict with this trait.Gets the valid places in a model that this trait can be applied.Gets thestructurallyExclusiveproperty of the trait.inthashCode()booleanbooleanTake this object and create a builder that contains all of the current property values of this object.Methods inherited from class software.amazon.smithy.model.traits.AbstractTraitgetSourceLocation, setNodeCache, toNode, toShapeId, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.smithy.model.traits.TraitisSynthetic
- 
Field Details- 
ID
 
- 
- 
Constructor Details- 
TraitDefinition
 
- 
- 
Method Details- 
builder
- 
toBuilderDescription copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
- toBuilderin interface- ToSmithyBuilder<TraitDefinition>
- Returns:
- a builder for type T
 
- 
getSelectorGets the valid places in a model that this trait can be applied.- Returns:
- Returns the trait selector.
 
- 
getConflictsGets the trait names that conflict with this trait.- Returns:
- Returns the conflicting trait names.
 
- 
getStructurallyExclusiveGets thestructurallyExclusiveproperty of the trait.- Returns:
- Returns the structurallyExclusiveproperty of the trait.
 
- 
isStructurallyExclusiveByMemberpublic boolean isStructurallyExclusiveByMember()- Returns:
- Returns true if the trait is structurallyExclusiveby member.
 
- 
isStructurallyExclusiveByTargetpublic boolean isStructurallyExclusiveByTarget()- Returns:
- Returns true if the trait is structurallyExclusiveby target.
 
- 
getBreakingChanges- Returns:
- Returns the breaking change rules of the trait.
 
- 
createNodeDescription copied from class:AbstractTraitThe 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:
- createNodein class- AbstractTrait
- Returns:
- Returns the trait as a node.
 
- 
equals- Overrides:
- equalsin class- AbstractTrait
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- AbstractTrait
 
 
-