ehcache

net.sf.ehcache.config.generator.model
Class SimpleNodeAttribute

java.lang.Object
  extended by net.sf.ehcache.config.generator.model.SimpleNodeAttribute
All Implemented Interfaces:
NodeAttribute

public class SimpleNodeAttribute
extends Object
implements NodeAttribute

Implementation of the NodeAttribute interface

Author:
Abhishek Sanoujam

Constructor Summary
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
 
Method Summary
 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()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleNodeAttribute

public SimpleNodeAttribute(String name)
Constructor accepting the name of the attribute

Parameters:
name - the name of the attribute

SimpleNodeAttribute

public SimpleNodeAttribute(String name,
                           Enum value)
Constructor accepting name and Enum value of the attribute

Parameters:
name - the name of the attribute
value - the Enum value of the attribute

SimpleNodeAttribute

public SimpleNodeAttribute(String name,
                           int value)
Constructor accepting name and int value of the attribute

Parameters:
name - the name of the attribute
value - the int value of the attribute

SimpleNodeAttribute

public SimpleNodeAttribute(String name,
                           long value)
Constructor accepting name and long value of the attribute

Parameters:
name - the name of the attribute
value - the long value of the attribute

SimpleNodeAttribute

public SimpleNodeAttribute(String name,
                           boolean value)
Constructor accepting name and boolean value of the attribute

Parameters:
name - the name of the attribute
value - the boolean value of the attribute

SimpleNodeAttribute

public SimpleNodeAttribute(String name,
                           String value)
Constructor accepting name and String value of the attribute

Parameters:
name - the name of the attribute
value - the String value of the attribute
Method Detail

getName

public String getName()
Name of the attribute

Specified by:
getName in interface NodeAttribute
Returns:
Name of the attribute

getValue

public String getValue()
Value of the attribute

Specified by:
getValue in interface NodeAttribute
Returns:
value of the attribute

isOptional

public boolean isOptional()
Returns true if the attribute is optional, otherwise false

Specified by:
isOptional in interface NodeAttribute
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:
setOptional in interface NodeAttribute
Parameters:
optional - true if this attribute is optional

getDefaultValue

public String getDefaultValue()
Returns the default value of the attribute

Specified by:
getDefaultValue in interface NodeAttribute
Returns:
default value of the attribute

setDefaultValue

public void setDefaultValue(String defaultValue)
Default value setter

Specified by:
setDefaultValue in interface NodeAttribute
Parameters:
defaultValue - the default value

setValue

public void setValue(String value)
Setter for value

Specified by:
setValue in interface NodeAttribute
Parameters:
value - the new value

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object

optional

public SimpleNodeAttribute optional(boolean optional)
Builder convenience method for setting optional

Specified by:
optional in interface NodeAttribute
Parameters:
optional - true if optional
Returns:
the same attribute instance

defaultValue

public SimpleNodeAttribute defaultValue(String defaultValue)
Builder convenience method for setting defaultValue

Specified by:
defaultValue in interface NodeAttribute
Parameters:
defaultValue - the default value
Returns:
the same attribute instance

defaultValue

public SimpleNodeAttribute defaultValue(boolean defaultValue)
Same as defaultValue(String) using String.valueOf(defaultValue)

Parameters:
defaultValue - the default value
Returns:
the same instance

defaultValue

public SimpleNodeAttribute defaultValue(int defaultValue)
Same as defaultValue(String) using String.valueOf(defaultValue)

Parameters:
defaultValue - the default value
Returns:
the same instance

defaultValue

public SimpleNodeAttribute defaultValue(Enum defaultValue)
Same as defaultValue(String) using String.valueOf(defaultValue)

Parameters:
defaultValue - the default value
Returns:
the same instance

defaultValue

public SimpleNodeAttribute defaultValue(long defaultValue)
Same as defaultValue(String) using String.valueOf(defaultValue)

Parameters:
defaultValue - the default value
Returns:
the same instance

ehcache

Copyright 2001-2014, Terracotta, Inc.