Package com.iizix.prop
Class CodeItemImpl
- java.lang.Object
- com.iizix.prop.CodeItemImpl
Constructor Summary
Constructors Constructor Description CodeItemImpl(KString value)Constructor for an item without code.CodeItemImpl(java.lang.String value)Constructor for an item without code.CodeItemImpl(java.lang.String code, KString value)Constructor for an item with code and value.CodeItemImpl(java.lang.String code, java.lang.String value)Constructor for an item with code and value.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodeItemImplclone()Clones the instance.booleanequals(java.lang.Object o)Checks for equality.java.lang.StringgetCode()Gets the code string.KStringgetKString()Gets the item text as a KString.java.lang.StringgetString()Gets the item text as a String.java.lang.ObjectgetValue()Gets the value.booleanhasCode()Checks if this item has a code.booleanisKString()Returns whether the item is a KString or not.
Constructor Detail
CodeItemImpl
public CodeItemImpl(java.lang.String value)
Constructor for an item without code.- Parameters:
value- The item value, never null.- Throws:
java.lang.NullPointerException- If item value is null.
CodeItemImpl
public CodeItemImpl(java.lang.String code, java.lang.String value)Constructor for an item with code and value.- Parameters:
code- The code, perhaps null for none.value- The item value, never null.- Throws:
java.lang.NullPointerException- If item value is null.
CodeItemImpl
public CodeItemImpl(KString value)
Constructor for an item without code.- Parameters:
value- The item value, never null.- Throws:
java.lang.NullPointerException- If item value is null.
CodeItemImpl
public CodeItemImpl(java.lang.String code, KString value)Constructor for an item with code and value.- Parameters:
code- The code, perhaps null for none.value- The item value, never null.- Throws:
java.lang.NullPointerException- If item value is null.
Method Detail
clone
public CodeItemImpl clone()
Clones the instance.- Overrides:
clonein classjava.lang.Object- Returns:
- The cloned instance if it contains a KString, otherwise "this" instance.
equals
public boolean equals(java.lang.Object o)
Checks for equality.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- Another object.- Returns:
- true if equal, false otherwise.
hasCode
public boolean hasCode()
Checks if this item has a code.
isKString
public boolean isKString()
Returns whether the item is a KString or not.
getCode
public java.lang.String getCode()
Gets the code string.
getString
public java.lang.String getString()
Gets the item text as a String.
getKString
public KString getKString()
Gets the item text as a KString.- Specified by:
getKStringin interfaceICodeItem- Returns:
- The item KString, potentially converted from String.