public class SimpleNodeAttribute extends Object implements NodeAttribute
NodeAttribute
interfaceConstructor and Description |
---|
SimpleNodeAttribute(String name)
Constructor accepting the name of the attribute
|
SimpleNodeAttribute(String name,
boolean value)
Constructor accepting name and boolean value of the attribute
|
SimpleNodeAttribute(String name,
Enum value)
Constructor accepting name and Enum value of the attribute
|
SimpleNodeAttribute(String name,
int value)
Constructor accepting name and int value of the attribute
|
SimpleNodeAttribute(String name,
long value)
Constructor accepting name and long value of the attribute
|
SimpleNodeAttribute(String name,
String value)
Constructor accepting name and String value of the attribute
|
Modifier and Type | Method and Description |
---|---|
SimpleNodeAttribute |
defaultValue(boolean defaultValue)
Same as
defaultValue(String) using String.valueOf(defaultValue) |
SimpleNodeAttribute |
defaultValue(Enum defaultValue)
Same as
defaultValue(String) using String.valueOf(defaultValue) |
SimpleNodeAttribute |
defaultValue(int defaultValue)
Same as
defaultValue(String) using String.valueOf(defaultValue) |
SimpleNodeAttribute |
defaultValue(long defaultValue)
Same as
defaultValue(String) using String.valueOf(defaultValue) |
SimpleNodeAttribute |
defaultValue(String defaultValue)
Builder convenience method for setting defaultValue
|
boolean |
equals(Object obj) |
String |
getDefaultValue()
Returns the default value of the attribute
|
String |
getName()
Name of the attribute
|
String |
getValue()
Value of the attribute
|
int |
hashCode() |
boolean |
isOptional()
Returns true if the attribute is optional, otherwise false
|
SimpleNodeAttribute |
optional(boolean optional)
Builder convenience method for setting optional
|
void |
setDefaultValue(String defaultValue)
Default value setter
|
void |
setOptional(boolean optional)
Sets this attribute to optional or not
|
void |
setValue(String value)
Setter for value
|
String |
toString() |
public SimpleNodeAttribute(String name)
name
- the name of the attributepublic SimpleNodeAttribute(String name, Enum value)
name
- the name of the attributevalue
- the Enum value of the attributepublic SimpleNodeAttribute(String name, int value)
name
- the name of the attributevalue
- the int value of the attributepublic SimpleNodeAttribute(String name, long value)
name
- the name of the attributevalue
- the long value of the attributepublic SimpleNodeAttribute(String name, boolean value)
name
- the name of the attributevalue
- the boolean value of the attributepublic String getName()
getName
in interface NodeAttribute
public String getValue()
getValue
in interface NodeAttribute
public boolean isOptional()
isOptional
in interface NodeAttribute
public void setOptional(boolean optional)
setOptional
in interface NodeAttribute
optional
- true if this attribute is optionalpublic String getDefaultValue()
getDefaultValue
in interface NodeAttribute
public void setDefaultValue(String defaultValue)
setDefaultValue
in interface NodeAttribute
defaultValue
- the default valuepublic void setValue(String value)
setValue
in interface NodeAttribute
value
- the new valuepublic SimpleNodeAttribute optional(boolean optional)
optional
in interface NodeAttribute
optional
- true if optionalpublic SimpleNodeAttribute defaultValue(String defaultValue)
defaultValue
in interface NodeAttribute
defaultValue
- the default valuepublic SimpleNodeAttribute defaultValue(boolean defaultValue)
defaultValue(String)
using String.valueOf(defaultValue)defaultValue
- the default valuepublic SimpleNodeAttribute defaultValue(int defaultValue)
defaultValue(String)
using String.valueOf(defaultValue)defaultValue
- the default valuepublic SimpleNodeAttribute defaultValue(Enum defaultValue)
defaultValue(String)
using String.valueOf(defaultValue)defaultValue
- the default valuepublic SimpleNodeAttribute defaultValue(long defaultValue)
defaultValue(String)
using String.valueOf(defaultValue)defaultValue
- the default valueCopyright 2001-2021, Terracotta, Inc.