jpos.config.simple
Class SimpleEntry.Prop

java.lang.Object
  |
  +--jpos.config.simple.SimpleEntry.Prop
All Implemented Interfaces:
java.lang.Comparable, JposEntry.Prop
Enclosing class:
SimpleEntry

public static class SimpleEntry.Prop
extends java.lang.Object
implements JposEntry.Prop, java.lang.Comparable

Inner class to represent a property of a JposEntry

Since:
1.3 (Washington DC 2001)
Author:
E. Michael Maximilien

Constructor Summary
SimpleEntry.Prop(java.lang.String name, java.lang.Object value)
          Creates a JposEntry.Prop object
 
Method Summary
 int compareTo(java.lang.Object other)
           
 JposEntry.Prop copy()
           
 boolean equals(java.lang.Object otherProp)
           
 java.lang.String getName()
           
 java.lang.Class getType()
          Returns the Class object that is the type of this property value possible values returned are the java.lang wrapper classes for the primitive types e.g.
 java.lang.Object getValue()
           
 java.lang.String getValueAsString()
           
 int hashCode()
           
 boolean isOfType(java.lang.Class type)
           
 void setName(java.lang.String s)
          Sets the name of this property
 void setValue(java.lang.Object objValue)
          Sets the value of this property (String).
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleEntry.Prop

public SimpleEntry.Prop(java.lang.String name,
                        java.lang.Object value)
                 throws java.lang.IllegalArgumentException
Creates a JposEntry.Prop object
Parameters:
name - the name of this property
value - the value of this property
Throws:
java.lang.IllegalArgumentException - if any of the arguments are null
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface JposEntry.Prop
Returns:
the name of this property

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface JposEntry.Prop
Returns:
the value of this property (the value is returned as an Object)

getValueAsString

public java.lang.String getValueAsString()
Specified by:
getValueAsString in interface JposEntry.Prop
Returns:
the value of this property as a String

getType

public java.lang.Class getType()
Returns the Class object that is the type of this property value possible values returned are the java.lang wrapper classes for the primitive types e.g. Integer, Byte, Boolean, ...
Specified by:
getType in interface JposEntry.Prop
Returns:
the type of this property as a java.lang.Class object

setName

public void setName(java.lang.String s)
             throws java.lang.IllegalArgumentException
Sets the name of this property
Specified by:
setName in interface JposEntry.Prop
Parameters:
s - the String object
Throws:
java.lang.IllegalArgumentException - if the argument is null

setValue

public void setValue(java.lang.Object objValue)
              throws java.lang.IllegalArgumentException
Sets the value of this property (String). Also sets its Type.

This is the default type of any property

Specified by:
setValue in interface JposEntry.Prop
Parameters:
objValue - the object's value
Throws:
java.lang.IllegalArgumentException - if the value is null or that this is not a valid typed property value

isOfType

public boolean isOfType(java.lang.Class type)
Specified by:
isOfType in interface JposEntry.Prop
Parameters:
type - the Class object
Returns:
true if the property is of the type specified by the Class object passed

copy

public JposEntry.Prop copy()
Specified by:
copy in interface JposEntry.Prop
Returns:
a new copy of this JposEntry.Prop object

equals

public boolean equals(java.lang.Object otherProp)
Specified by:
equals in interface JposEntry.Prop
Overrides:
equals in class java.lang.Object
Parameters:
otherProp - the other JposEntry.Prop
Returns:
true if this and otherProp have same name and value

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable
Parameters:
otherEntry - the other JposEntry
Returns:
0 if two entries are the same -1 if this is less or 1 of more than other the comparison for > and < uses the logicalName of the entry to decide

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
a unique key for this object


This API and code belongs to the JavaPOS committee please see LISCENCE file for details