|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openptk.api.Attribute
public class Attribute
The Attribute is used to store a related name / value and meta-data. An Attribute can be one of the following DataType enumerations, if not specified the default is STRING:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.openptk.api.AttributeIF |
---|
AttributeIF.Access |
Constructor Summary | |
---|---|
Attribute(AttributeIF attribute)
Creates a new Attribute from an existing Attribute. |
|
Attribute(java.lang.String name)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
boolean value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.Boolean value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
boolean[] value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.Boolean[] value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
int value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
int[] value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.Integer value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.Integer[] value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.Long value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.Long[] value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.Object value)
Creates a new Attribute using the provided name and value. |
|
Attribute(java.lang.String name,
java.lang.Object[] value)
Creates a new Attribute using the provided name and value. |
|
Attribute(java.lang.String name,
java.lang.String value)
Creates a new Attribute using the provided name. |
|
Attribute(java.lang.String name,
java.lang.String[] value)
Creates a new Attribute using the provided name. |
Method Summary | |
---|---|
boolean |
allowMultivalue()
Return TRUE if the Attribute allows multivalues. |
AttributeIF |
copy()
Returns a "deep" copy of the Attribute. |
AttributeIF.Access |
getAccess()
Get the Attributes Access level. |
java.lang.String |
getAccessAsString()
Get the String representation of the Attributes Access level. |
java.lang.String |
getName()
Get the Attributes name. |
java.util.Properties |
getProperties()
Returns the Properties for the Attribute. |
int |
getPropertiesSize()
Returns the quantity of Properties. |
java.lang.String |
getProperty(java.lang.String key)
Get the Property value from the Attribute. |
State |
getState()
Get the Attributes State. |
DataType |
getType()
Get the Attributes type. |
java.lang.String |
getTypeAsString()
Get the Attributes type, as a String. |
java.lang.Object |
getValue()
Get the Attributes value. |
java.lang.String |
getValueAsString()
Get the attributes value as a String, regardless of it's internal type. |
boolean |
isEncrypted()
Returns TRUE if the value is encrypted. |
boolean |
isMultivalued()
Return TRUE if the actual value is contains muliple values. |
boolean |
isReadOnly()
Get the Attributes read only flag. |
boolean |
isRequired()
Get the Attributes required flag. |
boolean |
isVirtual()
Get the Attributes virtual flag. |
void |
setAccess(AttributeIF.Access access)
Set the Attributes Access level. |
void |
setAccess(java.lang.String access)
Set the Attribute Access level. |
void |
setAllowMultivalue(boolean value)
Set the flag to define if the Attribute allows multivalues. |
void |
setEncrypted(boolean bEncrypted)
Set the flag to define if the Attribute value is encrypted. |
protected void |
setMultiValued(java.lang.Boolean bool)
Set the flag for a value, is it multivalued. |
void |
setProperties(java.util.Properties props)
Sets / Replaces the Attributes Properties. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Add the key / value as a Property to the Attribute. |
void |
setReadOnly(boolean value)
Set the Attributes read only flag. |
void |
setRequired(boolean bool)
Set the Attributes required flag. |
void |
setState(State state)
Set the Attributes State. |
void |
setType(DataType type)
Set the Attributes type (enum). |
void |
setValue(boolean value)
Set the Attributes value to a single Boolean. |
void |
setValue(java.lang.Boolean value)
Set the Attributes value to a single Boolean. |
void |
setValue(boolean[] value)
Set the Attributes value to a Boolean array. |
void |
setValue(java.lang.Boolean[] value)
Set the Attributes value to a Boolean array. |
void |
setValue(int value)
Set the Attributes value to a single Integer. |
void |
setValue(int[] value)
Set the Attributes value to a Integer array. |
void |
setValue(java.lang.Integer value)
Set the Attributes value to a single Integer. |
void |
setValue(java.lang.Integer[] value)
Set the Attributes value to a Integer array. |
void |
setValue(java.lang.Long value)
Set the Attributes value to a single Long. |
void |
setValue(java.lang.Long[] value)
Set the Attributes value to a Long array. |
void |
setValue(java.lang.Object value)
Set the Attributes value to the single Object. |
void |
setValue(java.lang.Object[] value)
Set the Attributes value to the Object array. |
void |
setValue(java.lang.String value)
Set the Attributes value to a single String. |
void |
setValue(java.lang.String[] value)
Set the Attributes value to a String array. |
void |
setVirtual(boolean bool)
Set the Attributes virtual flag. |
java.lang.String |
toString()
Get a String that represents the Attribute. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Attribute(AttributeIF attribute)
attribute
- an existing Attributepublic Attribute(java.lang.String name)
name
- the Attributes namepublic Attribute(java.lang.String name, boolean value)
name
- the Attributes namevalue
- the Attributes value [ true | false ]public Attribute(java.lang.String name, java.lang.Boolean value)
name
- the Attributes namevalue
- the Attributes value, Integer [ true | false ]public Attribute(java.lang.String name, boolean[] value)
name
- the Attributes namevalue
- the Attributes value, Boolean[]public Attribute(java.lang.String name, java.lang.Boolean[] value)
name
- the Attributes namevalue
- the Attributes value, Boolean[]public Attribute(java.lang.String name, int value)
name
- the Attributes namevalue
- the Attributes value, Integerpublic Attribute(java.lang.String name, int[] value)
name
- the Attributes namevalue
- the Attributes value, Integer[]public Attribute(java.lang.String name, java.lang.Integer value)
name
- the Attributes namevalue
- the Attributes value, Integerpublic Attribute(java.lang.String name, java.lang.Integer[] value)
name
- the Attributes namevalue
- the Attributes value, Integer[]public Attribute(java.lang.String name, java.lang.Long value)
name
- the Attributes namevalue
- the Attributes value, Longpublic Attribute(java.lang.String name, java.lang.Long[] value)
name
- the Attributes namevalue
- the Attributes value, Long[]public Attribute(java.lang.String name, java.lang.Object value)
name
- the Attributes namevalue
- the Attributes value, Java Objectpublic Attribute(java.lang.String name, java.lang.Object[] value)
name
- the Attributes namevalue
- the Attributes value, Java Object[]public Attribute(java.lang.String name, java.lang.String value)
name
- the Attributes namevalue
- the Attributes value, Stringpublic Attribute(java.lang.String name, java.lang.String[] value)
name
- the Attributes namevalue
- the Attributes value, String[]Method Detail |
---|
public final boolean allowMultivalue()
allowMultivalue
in interface AttributeIF
public AttributeIF copy()
copy
in interface AttributeIF
public final AttributeIF.Access getAccess()
getAccess
in interface AttributeIF
public final java.lang.String getAccessAsString()
getAccessAsString
in interface AttributeIF
public final java.lang.String getName()
getName
in interface AttributeIF
public final java.util.Properties getProperties()
getProperties
in interface AttributeIF
public final int getPropertiesSize()
getPropertiesSize
in interface AttributeIF
public final java.lang.String getProperty(java.lang.String key)
getProperty
in interface AttributeIF
key
- the name of the Property
public final State getState()
getState
in interface AttributeIF
public final DataType getType()
getType
in interface AttributeIF
public final java.lang.String getTypeAsString()
getTypeAsString
in interface AttributeIF
public final java.lang.Object getValue()
getValue
in interface AttributeIF
public final java.lang.String getValueAsString()
getValueAsString
in interface AttributeIF
public final boolean isEncrypted()
isEncrypted
in interface AttributeIF
public final boolean isMultivalued()
isMultivalued
in interface AttributeIF
public final boolean isReadOnly()
isReadOnly
in interface AttributeIF
public final boolean isRequired()
isRequired
in interface AttributeIF
public final boolean isVirtual()
isVirtual
in interface AttributeIF
public final void setAccess(AttributeIF.Access access)
setAccess
in interface AttributeIF
access
- Access levelpublic final void setAccess(java.lang.String access)
setAccess
in interface AttributeIF
access
- String representation of the levelpublic final void setAllowMultivalue(boolean value)
setAllowMultivalue
in interface AttributeIF
value
- public final void setEncrypted(boolean bEncrypted)
setEncrypted
in interface AttributeIF
bEncrypted
- protected void setMultiValued(java.lang.Boolean bool)
bool
- boolean is it multivalued.public final void setProperties(java.util.Properties props)
setProperties
in interface AttributeIF
props
- a Properties objectpublic final void setProperty(java.lang.String key, java.lang.String value)
setProperty
in interface AttributeIF
key
- the name of the Propertyvalue
- the value of the Propertypublic final void setReadOnly(boolean value)
setReadOnly
in interface AttributeIF
value
- flag to define if the Attribute is read onlypublic final void setRequired(boolean bool)
setRequired
in interface AttributeIF
bool
- flag to define if the Attribute is requiredpublic final void setState(State state)
setState
in interface AttributeIF
state
- Statepublic final void setType(DataType type)
setType
in interface AttributeIF
type
- DataTypepublic final void setValue(boolean value)
setValue
in interface AttributeIF
value
- booleanpublic final void setValue(java.lang.Boolean value)
setValue
in interface AttributeIF
value
- Booleanpublic final void setValue(boolean[] value)
setValue
in interface AttributeIF
value
- boolean[]public final void setValue(java.lang.Boolean[] value)
setValue
in interface AttributeIF
value
- Boolean[]public final void setValue(int value)
setValue
in interface AttributeIF
value
- intpublic final void setValue(int[] value)
setValue
in interface AttributeIF
value
- int[]public final void setValue(java.lang.Integer value)
setValue
in interface AttributeIF
value
- Integerpublic final void setValue(java.lang.Integer[] value)
setValue
in interface AttributeIF
value
- Integer[]public final void setValue(java.lang.Long value)
value
- Longpublic final void setValue(java.lang.Long[] value)
value
- Long[]public final void setValue(java.lang.Object value)
setValue
in interface AttributeIF
value
- Objectpublic final void setValue(java.lang.Object[] value)
setValue
in interface AttributeIF
value
- Object[]public final void setValue(java.lang.String value)
setValue
in interface AttributeIF
value
- Stringpublic final void setValue(java.lang.String[] value)
setValue
in interface AttributeIF
value
- String[]public final void setVirtual(boolean bool)
setVirtual
in interface AttributeIF
bool
- flag to define if the Attribute is virtualpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |