Module com.github.rvesse.airline
Class PortRestrictionFactory
- java.lang.Object
-
- com.github.rvesse.airline.restrictions.factories.PortRestrictionFactory
-
- All Implemented Interfaces:
ArgumentsRestrictionFactory
,OptionRestrictionFactory
public class PortRestrictionFactory extends java.lang.Object implements OptionRestrictionFactory, ArgumentsRestrictionFactory
-
-
Constructor Summary
Constructors Constructor Description PortRestrictionFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArgumentsRestriction
createArgumentsRestriction(java.lang.annotation.Annotation annotation)
Tries to create an arguments restriction from the given annotationprotected PortRestriction
createCommon(Port annotation)
protected PortRestriction
createCommon(PortRange... ranges)
OptionRestriction
createOptionRestriction(java.lang.annotation.Annotation annotation)
Try and create an option restriction from the given annotationprotected PortRange
createRange(PortRange rangeAnnotation)
protected 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:ArgumentsRestrictionFactory
Tries to create an arguments restriction from the given annotation- Specified by:
createArgumentsRestriction
in interfaceArgumentsRestrictionFactory
- Parameters:
annotation
- Annotation- Returns:
- Arguments restriction or
null
if this factory cannot create a restriction from the given annotation
-
createOptionRestriction
public OptionRestriction createOptionRestriction(java.lang.annotation.Annotation annotation)
Description copied from interface:OptionRestrictionFactory
Try and create an option restriction from the given annotation- Specified by:
createOptionRestriction
in interfaceOptionRestrictionFactory
- Parameters:
annotation
- Annotation- Returns:
- Option restriction or
null
if this factory cannot create a restriction from the given annotation
-
createCommon
protected final PortRestriction createCommon(Port annotation)
-
createCommon
protected final PortRestriction createCommon(PortRange... ranges)
-
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:ArgumentsRestrictionFactory
Gets a list of annotations that this factory can convert into arguments restrictions- Specified by:
supportedArgumentsAnnotations
in interfaceArgumentsRestrictionFactory
- Returns:
- List of supported annotations
-
supportedOptionAnnotations
public java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> supportedOptionAnnotations()
Description copied from interface:OptionRestrictionFactory
Gets a list of annotations that this factory can convert into option restrictions- Specified by:
supportedOptionAnnotations
in interfaceOptionRestrictionFactory
- Returns:
- List of supported annotations
-
-