Package org.gcube.smartgears.context
Class Property
- java.lang.Object
-
- org.gcube.smartgears.context.Property
-
public class Property extends Object
A named property with a value and a description.- Author:
- Fabio Simeoni
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdescription()Returns the description of this property.voiddisplay(boolean display)Sets whether the property is intended for displaybooleanequals(Object obj)inthashCode()booleanis(Class<?> type)Returnstrueif the value of this property has a given type.booleanisDisplay()Returnstrueif the property is intended for displayStringname()Returns the name of this property.StringtoString()Objectvalue()Returns the value of this property.<S> Svalue(Class<S> type)Returns the value of this property under a given type.
-
-
-
Method Detail
-
name
public String name()
Returns the name of this property.- Returns:
- the name
-
display
public void display(boolean display)
Sets whether the property is intended for display- Parameters:
display-trueif the property is intended for display
-
isDisplay
public boolean isDisplay()
Returnstrueif the property is intended for display- Returns:
trueif the property is intended for display
-
value
public Object value()
Returns the value of this property.- Returns:
- the value
-
value
public <S> S value(Class<S> type)
Returns the value of this property under a given type.- Returns:
- the value
- Throws:
IllegalStateException- if the value cannot be returned under the given type.
-
is
public boolean is(Class<?> type)
Returnstrueif the value of this property has a given type.- Parameters:
type- the type- Returns:
trueif the value of this property has a given type
-
description
public String description()
Returns the description of this property.- Returns:
- the description
-
-