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 CodeItemImpl
clone()
Clones the instance.boolean
equals(java.lang.Object o)
Checks for equality.java.lang.String
getCode()
Gets the code string.KString
getKString()
Gets the item text as a KString.java.lang.String
getString()
Gets the item text as a String.java.lang.Object
getValue()
Gets the value.boolean
hasCode()
Checks if this item has a code.boolean
isKString()
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:
clone
in 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:
equals
in 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:
getKString
in interfaceICodeItem
- Returns:
- The item KString, potentially converted from String.