Class SimpleNodeAttribute
- java.lang.Object
-
- net.sf.ehcache.config.generator.model.SimpleNodeAttribute
-
- All Implemented Interfaces:
NodeAttribute
public class SimpleNodeAttribute extends java.lang.Object implements NodeAttribute
Implementation of theNodeAttributeinterface- Author:
- Abhishek Sanoujam
-
-
Constructor Summary
Constructors Constructor Description SimpleNodeAttribute(java.lang.String name)Constructor accepting the name of the attributeSimpleNodeAttribute(java.lang.String name, boolean value)Constructor accepting name and boolean value of the attributeSimpleNodeAttribute(java.lang.String name, int value)Constructor accepting name and int value of the attributeSimpleNodeAttribute(java.lang.String name, long value)Constructor accepting name and long value of the attributeSimpleNodeAttribute(java.lang.String name, java.lang.Enum value)Constructor accepting name and Enum value of the attributeSimpleNodeAttribute(java.lang.String name, java.lang.String value)Constructor accepting name and String value of the attribute
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleNodeAttributedefaultValue(boolean defaultValue)Same asdefaultValue(String)using String.valueOf(defaultValue)SimpleNodeAttributedefaultValue(int defaultValue)Same asdefaultValue(String)using String.valueOf(defaultValue)SimpleNodeAttributedefaultValue(long defaultValue)Same asdefaultValue(String)using String.valueOf(defaultValue)SimpleNodeAttributedefaultValue(java.lang.Enum defaultValue)Same asdefaultValue(String)using String.valueOf(defaultValue)SimpleNodeAttributedefaultValue(java.lang.String defaultValue)Builder convenience method for setting defaultValuebooleanequals(java.lang.Object obj)java.lang.StringgetDefaultValue()Returns the default value of the attributejava.lang.StringgetName()Name of the attributejava.lang.StringgetValue()Value of the attributeinthashCode()booleanisOptional()Returns true if the attribute is optional, otherwise falseSimpleNodeAttributeoptional(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 valuejava.lang.StringtoString()
-
-
-
Constructor Detail
-
SimpleNodeAttribute
public SimpleNodeAttribute(java.lang.String name)
Constructor accepting the name of the attribute- Parameters:
name- the name of the attribute
-
SimpleNodeAttribute
public SimpleNodeAttribute(java.lang.String name, java.lang.Enum value)Constructor accepting name and Enum value of the attribute- Parameters:
name- the name of the attributevalue- the Enum value of the attribute
-
SimpleNodeAttribute
public SimpleNodeAttribute(java.lang.String name, int value)Constructor accepting name and int value of the attribute- Parameters:
name- the name of the attributevalue- the int value of the attribute
-
SimpleNodeAttribute
public SimpleNodeAttribute(java.lang.String name, long value)Constructor accepting name and long value of the attribute- Parameters:
name- the name of the attributevalue- the long value of the attribute
-
SimpleNodeAttribute
public SimpleNodeAttribute(java.lang.String name, boolean value)Constructor accepting name and boolean value of the attribute- Parameters:
name- the name of the attributevalue- the boolean value of the attribute
-
SimpleNodeAttribute
public SimpleNodeAttribute(java.lang.String name, java.lang.String value)Constructor accepting name and String value of the attribute- Parameters:
name- the name of the attributevalue- the String value of the attribute
-
-
Method Detail
-
getName
public java.lang.String getName()
Name of the attribute- Specified by:
getNamein interfaceNodeAttribute- Returns:
- Name of the attribute
-
getValue
public java.lang.String getValue()
Value of the attribute- Specified by:
getValuein interfaceNodeAttribute- Returns:
- value of the attribute
-
isOptional
public boolean isOptional()
Returns true if the attribute is optional, otherwise false- Specified by:
isOptionalin interfaceNodeAttribute- Returns:
- Returns true if the attribute is optional, otherwise false
-
setOptional
public void setOptional(boolean optional)
Sets this attribute to optional or not- Specified by:
setOptionalin interfaceNodeAttribute- Parameters:
optional- true if this attribute is optional
-
getDefaultValue
public java.lang.String getDefaultValue()
Returns the default value of the attribute- Specified by:
getDefaultValuein interfaceNodeAttribute- Returns:
- default value of the attribute
-
setDefaultValue
public void setDefaultValue(java.lang.String defaultValue)
Default value setter- Specified by:
setDefaultValuein interfaceNodeAttribute- Parameters:
defaultValue- the default value
-
setValue
public void setValue(java.lang.String value)
Setter for value- Specified by:
setValuein interfaceNodeAttribute- Parameters:
value- the new value
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
optional
public SimpleNodeAttribute optional(boolean optional)
Builder convenience method for setting optional- Specified by:
optionalin interfaceNodeAttribute- Parameters:
optional- true if optional- Returns:
- the same attribute instance
-
defaultValue
public SimpleNodeAttribute defaultValue(java.lang.String defaultValue)
Builder convenience method for setting defaultValue- Specified by:
defaultValuein interfaceNodeAttribute- Parameters:
defaultValue- the default value- Returns:
- the same attribute instance
-
defaultValue
public SimpleNodeAttribute defaultValue(boolean defaultValue)
Same asdefaultValue(String)using String.valueOf(defaultValue)- Parameters:
defaultValue- the default value- Returns:
- the same instance
-
defaultValue
public SimpleNodeAttribute defaultValue(int defaultValue)
Same asdefaultValue(String)using String.valueOf(defaultValue)- Parameters:
defaultValue- the default value- Returns:
- the same instance
-
defaultValue
public SimpleNodeAttribute defaultValue(java.lang.Enum defaultValue)
Same asdefaultValue(String)using String.valueOf(defaultValue)- Parameters:
defaultValue- the default value- Returns:
- the same instance
-
defaultValue
public SimpleNodeAttribute defaultValue(long defaultValue)
Same asdefaultValue(String)using String.valueOf(defaultValue)- Parameters:
defaultValue- the default value- Returns:
- the same instance
-
-