Interface NodeAttribute
-
- All Known Implementing Classes:
SimpleNodeAttribute
public interface NodeAttributeInterface that abstracts the idea of an attribute. An attribute has a name, a value, boolean indicating if its an optional attribute and a default value- Author:
- Abhishek Sanoujam
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NodeAttributedefaultValue(java.lang.String defaultValue)Builder convenience method for setting defaultValuejava.lang.StringgetDefaultValue()Returns the default value of the attributejava.lang.StringgetName()Name of the attributejava.lang.StringgetValue()Value of the attributebooleanisOptional()Returns true if the attribute is optional, otherwise falseNodeAttributeoptional(boolean optional)Builder convenience method for setting optionalvoidsetDefaultValue(java.lang.String defaultValue)Default value settervoidsetOptional(boolean optional)Sets this attribute to optional or notvoidsetValue(java.lang.String value)Setter for value
-
-
-
Method Detail
-
getName
java.lang.String getName()
Name of the attribute- Returns:
- Name of the attribute
-
getValue
java.lang.String getValue()
Value of the attribute- Returns:
- value of the attribute
-
isOptional
boolean isOptional()
Returns true if the attribute is optional, otherwise false- Returns:
- Returns true if the attribute is optional, otherwise false
-
getDefaultValue
java.lang.String getDefaultValue()
Returns the default value of the attribute- Returns:
- default value of the attribute
-
setOptional
void setOptional(boolean optional)
Sets this attribute to optional or not- Parameters:
optional- true if this attribute is optional
-
setDefaultValue
void setDefaultValue(java.lang.String defaultValue)
Default value setter- Parameters:
defaultValue- the default value
-
setValue
void setValue(java.lang.String value)
Setter for value- Parameters:
value- the new value
-
optional
NodeAttribute optional(boolean optional)
Builder convenience method for setting optional- Parameters:
optional- true if optional- Returns:
- the same attribute instance
-
defaultValue
NodeAttribute defaultValue(java.lang.String defaultValue)
Builder convenience method for setting defaultValue- Parameters:
defaultValue- the default value- Returns:
- the same attribute instance
-
-