Class PatternTrait

All Implemented Interfaces:
FromSourceLocation, ToNode, ToShapeId, Trait

public final class PatternTrait extends StringTrait
Restricts string values to a specified regular expression.
  • Field Details

    • ID

      public static final ShapeId ID
  • Constructor Details

    • PatternTrait

      public PatternTrait(String value, SourceLocation sourceLocation)
    • PatternTrait

      public PatternTrait(String value)
  • Method Details

    • getPattern

      public Pattern getPattern()
      Gets the regex pattern.
      Returns:
      returns compiled regular expression.