Module com.github.rvesse.airline
Class OccurrencesRestrictionFactory
- java.lang.Object
-
- com.github.rvesse.airline.restrictions.factories.OccurrencesRestrictionFactory
-
- All Implemented Interfaces:
ArgumentsRestrictionFactory,OptionRestrictionFactory
public class OccurrencesRestrictionFactory extends java.lang.Object implements OptionRestrictionFactory, ArgumentsRestrictionFactory
An annotation used to mark that an option must occur at most onceTo more finely control the number of occurrences of an option use
MinOccurrencesandMaxOccurrences. If you simply wish to state that an option must occur then useRequired.
-
-
Constructor Summary
Constructors Constructor Description OccurrencesRestrictionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArgumentsRestrictioncreateArgumentsRestriction(java.lang.annotation.Annotation annotation)Tries to create an arguments restriction from the given annotationprotected OccurrencesRestrictioncreateCommon(java.lang.annotation.Annotation annotation)OptionRestrictioncreateOptionRestriction(java.lang.annotation.Annotation annotation)Try and create an option restriction from the given annotationprotected java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>>supportedAnnotations()java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>>supportedArgumentsAnnotations()Gets a list of annotations that this factory can convert into arguments restrictionsjava.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>>supportedOptionAnnotations()Gets a list of annotations that this factory can convert into option restrictions
-
-
-
Method Detail
-
createArgumentsRestriction
public ArgumentsRestriction createArgumentsRestriction(java.lang.annotation.Annotation annotation)
Description copied from interface:ArgumentsRestrictionFactoryTries to create an arguments restriction from the given annotation- Specified by:
createArgumentsRestrictionin interfaceArgumentsRestrictionFactory- Parameters:
annotation- Annotation- Returns:
- Arguments restriction or
nullif this factory cannot create a restriction from the given annotation
-
createOptionRestriction
public OptionRestriction createOptionRestriction(java.lang.annotation.Annotation annotation)
Description copied from interface:OptionRestrictionFactoryTry and create an option restriction from the given annotation- Specified by:
createOptionRestrictionin interfaceOptionRestrictionFactory- Parameters:
annotation- Annotation- Returns:
- Option restriction or
nullif this factory cannot create a restriction from the given annotation
-
createCommon
protected OccurrencesRestriction createCommon(java.lang.annotation.Annotation annotation)
-
supportedAnnotations
protected java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> supportedAnnotations()
-
supportedArgumentsAnnotations
public java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> supportedArgumentsAnnotations()
Description copied from interface:ArgumentsRestrictionFactoryGets a list of annotations that this factory can convert into arguments restrictions- Specified by:
supportedArgumentsAnnotationsin interfaceArgumentsRestrictionFactory- Returns:
- List of supported annotations
-
supportedOptionAnnotations
public java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> supportedOptionAnnotations()
Description copied from interface:OptionRestrictionFactoryGets a list of annotations that this factory can convert into option restrictions- Specified by:
supportedOptionAnnotationsin interfaceOptionRestrictionFactory- Returns:
- List of supported annotations
-
-