Package org.restlet.engine.resource
Class VariantInfo
- java.lang.Object
-
- org.restlet.representation.Variant
-
- org.restlet.engine.resource.VariantInfo
-
public class VariantInfo extends Variant
Variant that is declared by an annotated Java method.
-
-
Field Summary
Fields Modifier and Type Field Description private MethodAnnotationInfoannotationInfoThe optional annotation descriptor.private floatinputScoreAffinity between this variant and an incoming representation.
-
Constructor Summary
Constructors Constructor Description VariantInfo(MediaType mediaType)Constructor.VariantInfo(MediaType mediaType, MethodAnnotationInfo annotationInfo)Constructor.VariantInfo(Variant variant, MethodAnnotationInfo annotationInfo)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)Indicates if the current variant is equal to the given variant.MethodAnnotationInfogetAnnotationInfo()Returns the optional annotation descriptor.floatgetInputScore()Returns the affinity between this variant and an incoming representation.inthashCode()voidsetInputScore(float inputScore)Sets the affinity between this variant and an incoming representation.-
Methods inherited from class org.restlet.representation.Variant
createClientInfo, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
-
-
-
-
Field Detail
-
annotationInfo
private final MethodAnnotationInfo annotationInfo
The optional annotation descriptor.
-
inputScore
private float inputScore
Affinity between this variant and an incoming representation.
-
-
Constructor Detail
-
VariantInfo
public VariantInfo(MediaType mediaType)
Constructor.- Parameters:
mediaType- The media type.
-
VariantInfo
public VariantInfo(MediaType mediaType, MethodAnnotationInfo annotationInfo)
Constructor.- Parameters:
mediaType- The media type.annotationInfo- The optional annotation descriptor.
-
VariantInfo
public VariantInfo(Variant variant, MethodAnnotationInfo annotationInfo)
Constructor.- Parameters:
variant- The variant to enrich.annotationInfo- The optional annotation descriptor.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
Indicates if the current variant is equal to the given variant.
-
getAnnotationInfo
public MethodAnnotationInfo getAnnotationInfo()
Returns the optional annotation descriptor.- Returns:
- The optional annotation descriptor.
-
getInputScore
public float getInputScore()
Returns the affinity between this variant and an incoming representation.- Returns:
- The affinity between this variant and an incoming representation.
-
setInputScore
public void setInputScore(float inputScore)
Sets the affinity between this variant and an incoming representation.- Parameters:
inputScore- The affinity between this variant and an incoming representation.
-
-