Interface Key
-
- All Known Subinterfaces:
AnimationCollectionKey
,AnimationPropertyKey
,AnnotationId
,AxisType
,ColorScheme
,DataLabelId
,IsEvent
,IsFill
,IsKeyboardKey
,IsLocaleItem
,IsProgressBarType
,IsShape
,IsToastType
,IsTooltipPosition
,IsTypedAnimationKey
,LabelId
,PropertyKey
,ScaleId
,TransitionKey
,Type
- All Known Implementing Classes:
AbsoluteDatasetIndexFill
,AbstractDataPoint.CharbaProperty
,AbstractKey
,AbstractPluginOptions.Property
,AbstractXYDataPoint.XYProperty
,Align
,Align
,Align
,Align
,Align
,Anchor
,Anchor
,AnimationEventType
,AnimationType
,AnnotationType
,AxisKind
,AxisPosition
,BarDatasetOptionsHandler.Property
,BorderAlign
,BorderItemType
,BorderSkipped
,BorderStyle
,Bounds
,BrewerScheme
,Calendar
,CalloutPosition
,CapStyle
,CharacterShape
,ChartAxisType
,ChartEventProperty
,ChartType
,ClipMap
,ColorMode
,ColorType
,CompactDisplay
,ContextType
,ControllerType
,CrossAlign
,CubicInterpolationMode
,Currency
,CurrencyDisplay
,CurrencySign
,CursorType
,CustomTooltipPosition
,DataPointType
,Dataset.CanvasObjectProperty
,Dataset.CommonProperty
,DatasetSeletionEventType
,DataType
,DateTimeStyle
,DecimationAlgorithm
,DefaultAnimationCollectionKey
,DefaultAnimationPropertyKey
,DefaultPluginId
,DefaultProgressBarType
,DefaultScaleId
,DefaultToastType
,DefaultTransitionKey
,Display
,Display
,DrawTime
,DrawTime
,DrawTime
,Easing
,ElementAlign
,Event
,Event
,EventType
,Fill
,FillHandler.Property
,FillingMode
,FontStyle
,FormatMatcher
,FormatPartType
,GlobalCompositeOperation
,GoogleChartScheme
,GradientOrientation
,GradientScope
,GradientType
,GwtMaterialScheme
,HourCycle
,Id
,ImageMimeType
,ImageShape
,IndexAxis
,InteractionAxis
,InteractionMode
,Interpolate
,JoinStyle
,KeyboardCommonKey
,KeyboardEditingKey
,KeyboardEventType
,KeyboardFunctionKey
,KeyboardModifierKey
,KeyboardNavigationKey
,KeyboardUiKey
,KeyboardWhitespaceKey
,LabelPosition
,Language
,LegendEventProperty
,LegendTextHandler.Property
,LocaleMatcher
,MeasureUnit
,MeasureUnitDisplay
,MixedItemStyle
,Mode
,Mode
,ModifierKey
,MouseEventType
,MutationType
,Notation
,NumberingSystem
,NumberItemStyle
,OfficeScheme
,Options.CommonProperty
,Overflow
,PluginOptionsScope
,PointerElement
,PointerEventType
,PointerType
,PointStyle
,PointStyleType
,Position
,Position
,Position
,Position
,Position
,Projection
,Region
,RegressionType
,RelativeDatasetIndexFill
,Render
,Render
,Repetition
,ResourceName
,ScaleTitleAlign
,SchemeScope
,Script
,Shape
,SignDisplay
,Size
,SpanGapHandler.Property
,Status
,Stepped
,StringItemStyle
,Style
,TableauScheme
,TextAlign
,TextBaseline
,TextDecoration
,TextDirection
,TickAlign
,TickSource
,TimeUnit
,TimeZone
,TimeZoneName
,TooltipAlign
,TooltipPosition
,TouchEventType
,Unit
,Weight
public interface Key
Represents the property key of a JavaScript object.
Used for enum.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T extends Key>
TcheckAndGetIfValid(T key)
Checks if key passed as argument is notnull
and its value is notnull
as well.
If not, throw aIllegalArgumentException
, otherwise it returns the key.static void
checkIfValid(Key key)
Checks if key passed as argument is notnull
and its value is notnull
as well.
If not, throw aIllegalArgumentException
.static int
compare(Key k1, Key k2)
Compares the two specified key values.static Key
create(String key)
Returns a key instance by its string value.static boolean
equals(Key k1, Key k2)
Returnstrue
if the keys have got the same value.static <T extends Key>
TgetKeyByValue(T[] enumValues, String value)
Returns a key in the an enumeration by the value.static <T extends Key>
TgetKeyByValue(T[] enumValues, String value, T defaultKey)
Returns a key in the an enumeration by the value, or the default key passed as argument.static <T extends Key>
booleanhasKeyByValue(T[] enumValues, String value)
Returnstrue
if a key in the an enumeration is related to the value, otherwisefalse
.static boolean
isValid(Key key)
Returnstrue
if key passed as argument is notnull
and its value is notnull
as well.String
value()
Returns the name value of property
-
-
-
Method Detail
-
create
static Key create(String key)
Returns a key instance by its string value.- Parameters:
key
- string value to use- Returns:
- a standard key instance
-
isValid
static boolean isValid(Key key)
Returnstrue
if key passed as argument is notnull
and its value is notnull
as well.- Parameters:
key
- key to be checked- Returns:
true
if key passed as argument is notnull
and its value is notnull
as well.
-
checkIfValid
static void checkIfValid(Key key)
Checks if key passed as argument is notnull
and its value is notnull
as well.
If not, throw aIllegalArgumentException
.- Parameters:
key
- key to be checked
-
checkAndGetIfValid
static <T extends Key> T checkAndGetIfValid(T key)
Checks if key passed as argument is notnull
and its value is notnull
as well.
If not, throw aIllegalArgumentException
, otherwise it returns the key.- Type Parameters:
T
- type of key- Parameters:
key
- key to be checked- Returns:
- the same key passed as argument
-
hasKeyByValue
static <T extends Key> boolean hasKeyByValue(T[] enumValues, String value)
Returnstrue
if a key in the an enumeration is related to the value, otherwisefalse
.- Type Parameters:
T
- type of key- Parameters:
enumValues
- enumeration values of keysvalue
- value to search in the key- Returns:
true
if a key in the an enumeration is related to the value, otherwisefalse
-
getKeyByValue
static <T extends Key> T getKeyByValue(T[] enumValues, String value)
Returns a key in the an enumeration by the value.- Type Parameters:
T
- type of key- Parameters:
enumValues
- enumeration values of keysvalue
- value to search in the key- Returns:
- the found key by value or
null
-
getKeyByValue
static <T extends Key> T getKeyByValue(T[] enumValues, String value, T defaultKey)
Returns a key in the an enumeration by the value, or the default key passed as argument.- Type Parameters:
T
- type of key- Parameters:
enumValues
- enumeration values of keysvalue
- value to search in the keydefaultKey
- default key instance if the value is not found- Returns:
- the found key by value or the default one
-
compare
static int compare(Key k1, Key k2)
Compares the two specified key values.- Parameters:
k1
- the first key to comparek2
- the second key to compare- Returns:
- the value 0 if k1 value is equal to k2; a value less than 0 if k1 value is less than k2; and a value greater than 0 if k1 value is greater than k2.
-
equals
static boolean equals(Key k1, Key k2)
Returnstrue
if the keys have got the same value.- Parameters:
k1
- the first key to comparek2
- the second key to compare- Returns:
true
if the keys have got the same value
-
value
String value()
Returns the name value of property- Returns:
- the name value of property
-
-